From eb1b335e967754a6f661327595e7432416dfb385 Mon Sep 17 00:00:00 2001 From: Zhufu <1176354795@qq.com> Date: Thu, 8 Aug 2024 18:12:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=99=90=E5=88=B650M=20?= =?UTF-8?q?=E8=B6=85=E6=97=B630=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Upload/src/components/FileUpload.vue | 18 +++++++++--------- src/utils/http/axios/index.ts | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/Upload/src/components/FileUpload.vue b/src/components/Upload/src/components/FileUpload.vue index f9cddcbe..788d3002 100644 --- a/src/components/Upload/src/components/FileUpload.vue +++ b/src/components/Upload/src/components/FileUpload.vue @@ -188,15 +188,15 @@ // 防止弹出多个错误提示 setTimeout(() => (isActMsg.value = true), 1000); } - // const isLt = file.size / 1024 / 1024 > maxSize; - // if (isLt) { - // createMessage.error(t('component.upload.maxSizeMultiple', [maxSize])); - // isLtMsg.value = false; - // // 防止弹出多个错误提示 - // setTimeout(() => (isLtMsg.value = true), 1000); - // } - // return (isAct && !isLt) || Upload.LIST_IGNORE; - return isAct || Upload.LIST_IGNORE; + const isLt = file.size / 1024 / 1024 > 50; + if (isLt) { + createMessage.error(t('component.upload.maxSizeMultiple', [50])); + isLtMsg.value = false; + // 防止弹出多个错误提示 + setTimeout(() => (isLtMsg.value = true), 1000); + } + return (isAct && !isLt) || Upload.LIST_IGNORE; + // return isAct || Upload.LIST_IGNORE; }; async function customRequest(info: UploadRequestOption) { diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index 825bad95..ec4c9a92 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -233,7 +233,7 @@ function createAxios(opt?: Partial) { // authentication schemes,e.g: Bearer // authenticationScheme: 'Bearer', authenticationScheme: '', - timeout: 10 * 1000, + timeout: 30 * 1000, // 基础接口地址 // baseURL: globSetting.apiUrl,