emacroh5lib 1.0.20 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/emacroh5lib.min.js +1 -1
- package/package.json +1 -1
- package/src/utilities/File.ts +3 -5
package/package.json
CHANGED
package/src/utilities/File.ts
CHANGED
@@ -9,7 +9,7 @@ export namespace EMacro {
|
|
9
9
|
|
10
10
|
public static getFileMD5(file: File): string {
|
11
11
|
|
12
|
-
|
12
|
+
throw "NG"
|
13
13
|
}
|
14
14
|
|
15
15
|
private static getBase64(blob) {
|
@@ -40,7 +40,7 @@ export namespace EMacro {
|
|
40
40
|
}
|
41
41
|
|
42
42
|
// 文件上传
|
43
|
-
public static uploadFiles(files,
|
43
|
+
public static uploadFiles(files, postFunc, errFunc: (err) => {}) {
|
44
44
|
|
45
45
|
if (files[0].fileName == "" || files[0].fileSize == "" || files[0].fileSize == 0) {
|
46
46
|
throw new Error("请选择要上传的文件")
|
@@ -52,7 +52,6 @@ export namespace EMacro {
|
|
52
52
|
let { fileChunks, sliceSize, chunksLength } = File.getFileChunks(file.file)
|
53
53
|
for (let index in fileChunks) {
|
54
54
|
let chunk = fileChunks[Number(index)]
|
55
|
-
|
56
55
|
setTimeout(async () => {
|
57
56
|
await File.getBase64(chunk).then((base64: any) => {
|
58
57
|
let data = {
|
@@ -64,8 +63,7 @@ export namespace EMacro {
|
|
64
63
|
'fileName': file.file.name, // 文件名
|
65
64
|
'data': base64.split(';base64,')[1], // 文件数据
|
66
65
|
'lastModifiedDate': file.file.lastModifiedDate, // 最后修改时间
|
67
|
-
'dataType': 'base64'
|
68
|
-
'savePath': savePath
|
66
|
+
'dataType': 'base64' // 数据的类型
|
69
67
|
}
|
70
68
|
postFunc(data)
|
71
69
|
}).catch((err) => {
|