@smart-link/rn-im 1.1.4 → 1.1.5
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/utils/upload.js +4 -3
- package/package.json +2 -2
package/dist/utils/upload.js
CHANGED
|
@@ -16,8 +16,8 @@ const uploadFile = (filePath, type, onProgress) => __awaiter(void 0, void 0, voi
|
|
|
16
16
|
const local = yield fetch(toAbsolutePath(filePath));
|
|
17
17
|
const file = yield local.blob();
|
|
18
18
|
const fileName = filePath.split('/').pop();
|
|
19
|
-
//
|
|
20
|
-
if (file.size > CHUNK_SIZE) {
|
|
19
|
+
// 大文件20M以上, chunk上传
|
|
20
|
+
if (file.size > CHUNK_SIZE * 10) {
|
|
21
21
|
return uploadBigFile(toFullPath(filePath), fileName, onProgress);
|
|
22
22
|
}
|
|
23
23
|
const formData = new FormData();
|
|
@@ -45,7 +45,7 @@ const uploadBigFile = (filePath, fileName, onProgress) => __awaiter(void 0, void
|
|
|
45
45
|
'Cookie': cookie,
|
|
46
46
|
},
|
|
47
47
|
onProgress: (o) => {
|
|
48
|
-
console.log('uploadBigFile: ', o)
|
|
48
|
+
// console.log('uploadBigFile: ', o)
|
|
49
49
|
onProgress && onProgress({
|
|
50
50
|
loaded: o.loaded,
|
|
51
51
|
total: o.total,
|
|
@@ -54,6 +54,7 @@ const uploadBigFile = (filePath, fileName, onProgress) => __awaiter(void 0, void
|
|
|
54
54
|
});
|
|
55
55
|
},
|
|
56
56
|
});
|
|
57
|
+
console.log('uploadBigFile: ', resp);
|
|
57
58
|
return resp.data;
|
|
58
59
|
});
|
|
59
60
|
export default uploadFile;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart-link/rn-im",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"react-redux": "^8.1.3",
|
|
66
66
|
"redux": "^4.2.1",
|
|
67
67
|
"redux-thunk": "^2.4.2",
|
|
68
|
-
"@smart-link/rn-ui": "^1.1.
|
|
68
|
+
"@smart-link/rn-ui": "^1.1.3",
|
|
69
69
|
"@smart-link/im-base": "^1.1.2"
|
|
70
70
|
},
|
|
71
71
|
"files": [
|