From 91c843f098f083194a4cf7207690caecea91ffe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=B0=8F=E7=8E=8B=E5=AD=90?= Date: Thu, 7 Mar 2024 10:14:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=A4=A7=E5=86=99=E5=90=8E=E7=BC=80=E4=B8=8D=E5=B1=95?= =?UTF-8?q?=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 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/views/system/oss/index.vue b/src/views/system/oss/index.vue index 8a67a50..9774791 100644 --- a/src/views/system/oss/index.vue +++ b/src/views/system/oss/index.vue @@ -214,11 +214,10 @@ const getList = async () => { 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())); } /** 取消按钮 */ @@ -333,7 +332,7 @@ const handlePreviewListResource = async (preview: boolean) => { let text = preview ? '启用' : '停用'; try { await proxy?.$modal.confirm('确认要"' + text + '""预览列表图片"配置吗?'); - const res = await proxy?.getConfigKey('sys.oss.previewListResource'); + const res = await proxy?.getConfigKey('sys.oss.previewListResource'); await proxy?.updateConfigByKey('sys.oss.previewListResource', preview, res.data.version); await getList(); proxy?.$modal.msgSuccess(text + '成功');