fix: 解决上传文件夹失败的问题 (#2843)

This commit is contained in:
zhengkunwang 2023-11-08 10:37:30 +08:00 committed by GitHub
parent 8599a858e4
commit 4b4f53d09b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,7 +166,11 @@ const submit = async () => {
if (fileSize <= 1024 * 1024 * 50) {
const formData = new FormData();
formData.append('file', file.raw);
formData.append('path', path.value);
if (file.raw.webkitRelativePath != '') {
formData.append('path', path.value + '/' + getPathWithoutFilename(file.raw.webkitRelativePath));
} else {
formData.append('path', path.value);
}
await UploadFileData(formData, {});
success++;
uploaderFiles.value[i].status = 'success';