From c649e95d1300822c8dd57424ad2292003d72c3fc Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Fri, 15 Dec 2023 15:03:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/host/file-management/upload/index.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/host/file-management/upload/index.vue b/frontend/src/views/host/file-management/upload/index.vue index 22292f161156..9cf94b7788ea 100644 --- a/frontend/src/views/host/file-management/upload/index.vue +++ b/frontend/src/views/host/file-management/upload/index.vue @@ -94,6 +94,7 @@ import i18n from '@/lang'; import DrawerHeader from '@/components/drawer-header/index.vue'; import { MsgError, MsgSuccess } from '@/utils/message'; import { Close } from '@element-plus/icons-vue'; +import { TimeoutEnum } from '@/enums/http-enum'; interface UploadFileProps { path: string; @@ -235,7 +236,7 @@ const submit = async () => { const fileSize = file.size; uploadHelper.value = i18n.global.t('file.fileUploadStart', [file.name]); - if (fileSize <= 1024 * 1024 * 10) { + if (fileSize <= 1024 * 1024 * 5) { const formData = new FormData(); formData.append('file', file.raw); if (file.raw.webkitRelativePath != '') { @@ -254,7 +255,7 @@ const submit = async () => { success++; uploaderFiles.value[i].status = 'success'; } else { - const CHUNK_SIZE = 1024 * 1024 * 10; + const CHUNK_SIZE = 1024 * 1024 * 5; const chunkCount = Math.ceil(fileSize / CHUNK_SIZE); let uploadedChunkCount = 0; for (let c = 0; c < chunkCount; c++) { @@ -281,7 +282,7 @@ const submit = async () => { ); uploadPrecent.value = progress; }, - timeout: 40000, + timeout: TimeoutEnum.T_60S, }); uploadedChunkCount++; } catch (error) {