fix(系统设置): 上传字体文件后缀会区分大小写,建议优化

This commit is contained in:
dataeaseShu
2024-12-03 16:26:43 +08:00
parent 5fa386e821
commit bb01ff0a2f

View File

@@ -79,14 +79,14 @@ defineExpose({
})
const beforeAvatarUpload = rawFile => {
if (!rawFile.name.endsWith('.ttf')) {
if (!rawFile.name.toLocaleLowerCase().endsWith('.ttf')) {
ElMessage.error(t('system.in_ttf_format'))
return false
}
return true
}
const onChange = file => {
if (file.raw?.name.endsWith('.ttf')) {
if (file.raw?.name?.toLocaleLowerCase().endsWith('.ttf')) {
state.fileList = file
}
}