|
@@ -99,7 +99,7 @@ export const onFileUpload = ({
|
|
|
const cos = new COS({
|
|
|
// getAuthorization 必选参数
|
|
|
getAuthorization: async (options, callback: any) => {
|
|
|
- console.log(options, { Authorization: data.signature });
|
|
|
+ // console.log(options, { Authorization: data.signature });
|
|
|
callback({ Authorization: data.signature });
|
|
|
}
|
|
|
});
|
|
@@ -112,17 +112,17 @@ export const onFileUpload = ({
|
|
|
Key: `ktqy/${data.name}`,
|
|
|
/* 存储在桶里的对象键(例如:1.jpg,a/b/test.txt,图片.jpg)支持中文,必须字段 */
|
|
|
Body: data.file.file, // 上传文件对象
|
|
|
- // SliceSize:
|
|
|
- // 1024 *
|
|
|
- // 1024 *
|
|
|
- // 5 /* 触发分块上传的阈值,超过5MB使用分块上传,小于5MB使用简单上传。可自行设置,非必须 */,
|
|
|
+ SliceSize:
|
|
|
+ 1024 *
|
|
|
+ 1024 *
|
|
|
+ 5 /* 触发分块上传的阈值,超过5MB使用分块上传,小于5MB使用简单上传。可自行设置,非必须 */,
|
|
|
onProgress: function (progressData) {
|
|
|
console.log(JSON.stringify(progressData));
|
|
|
}
|
|
|
})
|
|
|
.then((res: any) => {
|
|
|
console.log(res, 'res');
|
|
|
- onFinish();
|
|
|
+ onFinish(res);
|
|
|
})
|
|
|
.catch(error => {
|
|
|
console.log(error, 'error');
|