fix: 解决拖动上传文件夹错误的问题 (#3983)

pull/3987/head
zhengkunwang 9 months ago committed by GitHub
parent 49dcb094dc
commit 96233ee9b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -301,7 +301,7 @@ const submit = async () => {
const chunk = file.raw.slice(start, end);
const formData = new FormData();
formData.append('filename', file.name);
formData.append('filename', getFilenameFromPath(file.name));
if (file.raw.webkitRelativePath != '') {
formData.append('path', path.value + '/' + getPathWithoutFilename(file.raw.webkitRelativePath));
} else {
@ -350,6 +350,10 @@ const getPathWithoutFilename = (path: string) => {
return path ? path.split('/').slice(0, -1).join('/') : path;
};
const getFilenameFromPath = (path) => {
return path ? path.split('/').pop() : path;
};
const acceptParams = (props: UploadFileProps) => {
path.value = props.path;
open.value = true;

Loading…
Cancel
Save