From 4aba18dbdb2c6feba77d629ec20cea4f5ab8b1f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=A1=A5?= Date: Fri, 2 Feb 2024 13:36:35 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=A4=A7=E5=86=99=E5=90=8E=E7=BC=80=E4=B8=8D?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/oss/index.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/views/system/oss/index.vue b/src/views/system/oss/index.vue index ec117087..512897b8 100644 --- a/src/views/system/oss/index.vue +++ b/src/views/system/oss/index.vue @@ -201,11 +201,10 @@ const getList = async () => { loading.value = false; showTable.value = true; } -function checkFileSuffix(fileSuffix: string[]) { - let arr = ["png", "jpg", "jpeg"]; - return arr.some(type => { - return fileSuffix.indexOf(type) > -1; - }); +function checkFileSuffix(fileSuffix: string | string[]) { + const arr = [".png", ".jpg", ".jpeg"]; + const suffixArray = Array.isArray(fileSuffix) ? fileSuffix : [fileSuffix]; + return suffixArray.some(suffix => arr.includes(suffix.toLowerCase())); } /** 取消按钮 */ function cancel() { -- Gitee