提交 0c556484 编写于 作者: VK1688's avatar VK1688

update: ext-storage\dev.md

上级 2398cd63
...@@ -2619,17 +2619,23 @@ class ExtStorage { ...@@ -2619,17 +2619,23 @@ class ExtStorage {
const uploadTask = uni.uploadFile({ const uploadTask = uni.uploadFile({
...uploadFileOptionsRes.uploadFileOptions, // 上传文件所需参数 ...uploadFileOptionsRes.uploadFileOptions, // 上传文件所需参数
filePath, // 本地文件路径 filePath, // 本地文件路径
success: () => { success: (uploadFileRes) => {
const res = { if (uploadFileRes.statusCode !== 200) {
cloudPath: uploadFileOptionsRes.cloudPath, // 文件云端路径 const err = uploadFileRes;
fileID: uploadFileOptionsRes.fileID, // 文件ID if (typeof options.fail === "function") options.fail(err);
fileURL: uploadFileOptionsRes.fileURL, // 文件URL(如果是私有权限,则此URL是无法直接访问的) reject(err);
}; } else {
if (this.fileID2fileURL) { const res = {
res.fileID = `https://${this.domain}/${res.cloudPath}`; cloudPath: uploadFileOptionsRes.cloudPath, // 文件云端路径
fileID: uploadFileOptionsRes.fileID, // 文件ID
fileURL: uploadFileOptionsRes.fileURL, // 文件URL(如果是私有权限,则此URL是无法直接访问的)
};
if (this.fileID2fileURL) {
res.fileID = `https://${this.domain}/${res.cloudPath}`;
}
if (typeof options.success === "function") options.success(res);
resolve(res);
} }
if (typeof options.success === "function") options.success(res);
resolve(res);
}, },
fail: (err) => { fail: (err) => {
if (typeof options.fail === "function") options.fail(err); if (typeof options.fail === "function") options.fail(err);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册