|
@@ -61,7 +61,7 @@ async function completeMultipartUpload(parts, keyname) {
|
|
MultipartUpload: { Parts: parts },
|
|
MultipartUpload: { Parts: parts },
|
|
UploadId: uploadid
|
|
UploadId: uploadid
|
|
};
|
|
};
|
|
- await bucket.completeMultipartUpload(params).promise();
|
|
|
|
|
|
+ return await bucket.completeMultipartUpload(params).promise();
|
|
}
|
|
}
|
|
|
|
|
|
//中止分块上传
|
|
//中止分块上传
|
|
@@ -178,7 +178,7 @@ async function awsuploadpart(filestate, file, uploadid, parts, key) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//提交上传成功信息
|
|
//提交上传成功信息
|
|
- await completeMultipartUpload(completeparts, uploadid);
|
|
|
|
|
|
+ return await completeMultipartUpload(completeparts, uploadid);
|
|
}
|
|
}
|
|
|
|
|
|
//上传的接口
|
|
//上传的接口
|
|
@@ -203,12 +203,12 @@ async function awsupload(file, folderid, filestate) {
|
|
//如果已经部分存在,那么直接在节点续传
|
|
//如果已经部分存在,那么直接在节点续传
|
|
if (uploadid) {
|
|
if (uploadid) {
|
|
//断点续传
|
|
//断点续传
|
|
- awsuploadpart(filestate, file, uploadid, partsinfo.Parts, key);
|
|
|
|
|
|
+ return await awsuploadpart(filestate, file, uploadid, partsinfo.Parts, key);
|
|
}
|
|
}
|
|
//不存在,上传新的
|
|
//不存在,上传新的
|
|
else {
|
|
else {
|
|
const uploadid = await initMultiPartUpload(bucket, params); //初始化文件上传
|
|
const uploadid = await initMultiPartUpload(bucket, params); //初始化文件上传
|
|
- awsuploadpart(filestate, file, uploadid, [], key);
|
|
|
|
|
|
+ return await awsuploadpart(filestate, file, uploadid, [], key);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//如果已经上传成功了,那么直接返回状态百分百
|
|
//如果已经上传成功了,那么直接返回状态百分百
|
|
@@ -223,6 +223,5 @@ async function awsupload(file, folderid, filestate) {
|
|
filestate.status = "error";
|
|
filestate.status = "error";
|
|
console.log(err);
|
|
console.log(err);
|
|
}
|
|
}
|
|
- return filestate;
|
|
|
|
}
|
|
}
|
|
|
|
|