mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-27 20:49:03 +08:00
fix: 解决拖动上传文件夹错误的问题 (#3983)
This commit is contained in:
parent
49dcb094dc
commit
96233ee9b2
@ -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…
Reference in New Issue
Block a user