perf(projects): 增强文件校验的兼容性 (#1931)
This commit is contained in:
@@ -38,8 +38,8 @@
|
||||
})
|
||||
|
||||
const beforeImageUpload = (file) => {
|
||||
const isJPG = file.type === 'image/jpeg'
|
||||
const isPng = file.type === 'image/png'
|
||||
const isJPG = file.type?.toLowerCase() === 'image/jpeg'
|
||||
const isPng = file.type?.toLowerCase() === 'image/png'
|
||||
if (!isJPG && !isPng) {
|
||||
ElMessage.error('上传头像图片只能是 jpg或png 格式!')
|
||||
return false
|
||||
|
Reference in New Issue
Block a user