mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-27 20:49:03 +08:00
feat: 优化文件上传体验 (#4396)
This commit is contained in:
parent
e3eebc938a
commit
8a011b1cf9
@ -273,7 +273,7 @@ const submit = async () => {
|
||||
const fileSize = file.size;
|
||||
|
||||
uploadHelper.value = i18n.global.t('file.fileUploadStart', [file.name]);
|
||||
if (fileSize <= 1024 * 1024 * 5) {
|
||||
if (fileSize <= 1024 * 1024 * 10) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file.raw);
|
||||
if (file.raw.webkitRelativePath != '') {
|
||||
@ -281,6 +281,7 @@ const submit = async () => {
|
||||
} else {
|
||||
formData.append('path', path.value + '/' + getPathWithoutFilename(file.name));
|
||||
}
|
||||
formData.append('overwrite', 'True');
|
||||
uploadPercent.value = 0;
|
||||
await UploadFileData(formData, {
|
||||
onUploadProgress: (progressEvent) => {
|
||||
|
Loading…
Reference in New Issue
Block a user