Merge pull request #281 from wzy184249652/bugfix/upload-error

解决由于普通上传和秒传返回格式不统一导致的初次上传必然失败的bug
This commit is contained in:
邹景立 2023-11-24 22:45:25 +08:00 committed by GitHub
commit ad28cd3629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,7 +188,13 @@ define(['md5', 'notify'], function (SparkMD5, Notify, allowMime) {
});
} else if (parseInt(ret.code) === 200) {
(file.xurl = ret.data.url), that.progress('100.00', file);
that.done({code: 1, url: file.xurl, info: file.xstats}, file.index, file, done, '{:lang("文件秒传成功!")}');
that.done({
code: 1,
info: '{:lang("文件秒传成功!")}',
data: {
url: file.xurl,
}
}, file.index, file, done, '{:lang("文件秒传成功!")}');
} else {
that.event('upload.error', {file: file}, file, ret.info || ret.error.message || '{:lang("文件上传出错!")}');
}