修复文件预览大写后缀不展示的问题

This commit is contained in:
数据小王子 2024-03-07 10:14:28 +08:00
parent 81bfda2564
commit 91c843f098

View File

@ -214,11 +214,10 @@ const getList = async () => {
showTable.value = true; showTable.value = true;
}; };
function checkFileSuffix(fileSuffix: string[]) { function checkFileSuffix(fileSuffix: string | string[]) {
let arr = ['png', 'jpg', 'jpeg']; const arr = [".png", ".jpg", ".jpeg"];
return arr.some((type) => { const suffixArray = Array.isArray(fileSuffix) ? fileSuffix : [fileSuffix];
return fileSuffix.indexOf(type) > -1; return suffixArray.some(suffix => arr.includes(suffix.toLowerCase()));
});
} }
/** 取消按钮 */ /** 取消按钮 */