fix(baInput):文件后缀名大写时无法上传的问题

This commit is contained in:
妙码生花 2022-12-06 10:55:25 +08:00
parent 631bfe223e
commit 788e41e877

View File

@ -210,7 +210,7 @@ export const checkFileMimetype = (fileName: string, fileType: string) => {
const siteConfig = useSiteConfig()
const mimetype = siteConfig.upload.mimetype.toLowerCase().split(',')
const fileSuffix = fileName.substring(fileName.lastIndexOf('.') + 1)
const fileSuffix = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase()
if (siteConfig.upload.mimetype === '*' || mimetype.includes(fileSuffix) || mimetype.includes('.' + fileSuffix)) {
return true
}