1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-02-07 17:10:07 +08:00

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) { if (fileSize <= 1024 * 1024 * 50) {
const formData = new FormData(); const formData = new FormData();
formData.append('file', file.raw); 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, {}); await UploadFileData(formData, {});
success++; success++;
uploaderFiles.value[i].status = 'success'; uploaderFiles.value[i].status = 'success';