diff --git a/src/views/system/oss/index.vue b/src/views/system/oss/index.vue index ec11708790f9fcad0471a383aa2bb807ae0bac62..512897b849dcfa96852cf3ec4b541eb3a167cc4e 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() {