ChrisFuck 5 anni fa
parent
commit
c0a0c6fbbf
2 ha cambiato i file con 12 aggiunte e 10 eliminazioni
  1. 3
    3
      index.js
  2. 9
    7
      utils/contants.js

+ 3
- 3
index.js Vedi File

@@ -1,5 +1,5 @@
1
-import Constants from './utils/contants'
2
-import generateMd5 from './utils/utils'
1
+import { Constants } from './utils/contants'
2
+import { getFilemd5sum } from './utils/utils'
3 3
 
4 4
 function FileFactory(file) {
5 5
   this.offset = 0; //用于断点续传,默认为 0
@@ -18,7 +18,7 @@ FileFactory.prototype.setOffset = function (offset) {
18 18
 export default function UploadSdk(host, origin, token, file) {
19 19
 
20 20
   this.handlers = [] //用于处理出触发事件
21
-  this.host = host.indexOf('http:') > -1 ? 'http:'+ host
21
+  this.host = host.indexOf('http:') > -1 ? 'http:'+ host: host
22 22
   this.origin = origin
23 23
   this.token = token
24 24
   this.file = file

+ 9
- 7
utils/contants.js Vedi File

@@ -1,8 +1,10 @@
1
-export default const Constants = {
2
-  IMAGE_MULTIPART: '/multipart/upload/'
3
-  VIDEO_MULTIPART: '/upload/'
4
-  IMAGE_TYPE_ERROR: 101
5
-  VIDOE_TYPE_ERROR: 102
6
-  UPLOAD_SUCCESS_CODE: 200
1
+var Constants = {
2
+  IMAGE_MULTIPART: '/multipart/upload/',
3
+  VIDEO_MULTIPART: '/upload/',
4
+  IMAGE_TYPE_ERROR: 101,
5
+  VIDOE_TYPE_ERROR: 102,
6
+  UPLOAD_SUCCESS_CODE: 200,
7 7
   UPLOAD_FAILED_CODE: 400
8
-}
8
+}
9
+
10
+export { Constants }