diff --git a/frontend/src/views/host/file-management/create/index.vue b/frontend/src/views/host/file-management/create/index.vue index a41ed3db1..241d11abe 100644 --- a/frontend/src/views/host/file-management/create/index.vue +++ b/frontend/src/views/host/file-management/create/index.vue @@ -23,7 +23,7 @@ @submit.enter.prevent > - + @@ -105,9 +105,9 @@ const getMode = (val: number) => { let getPath = computed(() => { if (addForm.path.endsWith('/')) { - return addForm.path + addForm.name; + return addForm.path + addForm.name.trim(); } else { - return addForm.path + '/' + addForm.name; + return addForm.path + '/' + addForm.name.trim(); } }); @@ -133,6 +133,7 @@ const submit = async (formEl: FormInstance | undefined) => { if (!setRole.value) { addItem['mode'] = undefined; } + addItem['name'] = addForm.name.trim(); CreateFile(addItem as File.FileCreate) .then(() => { MsgSuccess(i18n.global.t('commons.msg.createSuccess')); diff --git a/frontend/src/views/host/file-management/upload/index.vue b/frontend/src/views/host/file-management/upload/index.vue index a1ee33c50..2d329e7b5 100644 --- a/frontend/src/views/host/file-management/upload/index.vue +++ b/frontend/src/views/host/file-management/upload/index.vue @@ -146,7 +146,6 @@ const handleDrop = async (event: DragEvent) => { initTempFiles(); event.preventDefault(); const items = event.dataTransfer?.items; - if (items) { const entries = Array.from(items).map((item) => item.webkitGetAsEntry()); await Promise.all(entries.map((entry) => traverseFileTree(entry))); @@ -183,7 +182,9 @@ const convertFileToUploadFile = (file: File, path: string): UploadFile => { const traverseFileTree = async (item: any, path = '') => { path = path || ''; - + if (!item) { + return; + } if (item.isFile) { if (tmpFiles.value.length > 1000) { breakFlag.value = true; diff --git a/frontend/src/views/login/components/login-form.vue b/frontend/src/views/login/components/login-form.vue index 6f2789b14..eeb149c35 100644 --- a/frontend/src/views/login/components/login-form.vue +++ b/frontend/src/views/login/components/login-form.vue @@ -41,8 +41,8 @@