8/6 校验问题
This commit is contained in:
@@ -367,14 +367,20 @@ const handleAvatarSuccess: UploadProps['onSuccess'] = (response) => {
|
||||
}
|
||||
};
|
||||
|
||||
const blockedExts = ['.exe', '.bat', '.cmd', '.msi'];
|
||||
const blockedExits = ['.exe', '.bat', '.cmd', '.msi'];
|
||||
const allowExits = ['.bmp", ".gif", ".jpg", ".jpeg", ".png'];
|
||||
const handleChangeFile = (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
|
||||
const ext = uploadFile.name.toLowerCase().slice(uploadFile.name.lastIndexOf('.'));
|
||||
if (blockedExts.includes(ext)) {
|
||||
if (blockedExits.includes(ext)) {
|
||||
ElMessage.warning(`禁止上传 ${ext} 文件`);
|
||||
uploadRef.value.handleRemove(uploadFile);
|
||||
return;
|
||||
}
|
||||
if (!allowExits.includes(ext)) {
|
||||
ElMessage.warning(`只允许上传jpg,jpeg,png等`);
|
||||
uploadRef.value.handleRemove(uploadFile);
|
||||
return;
|
||||
}
|
||||
fileList.value = uploadFiles;
|
||||
};
|
||||
const handleExceed = () => {
|
||||
|
||||
Reference in New Issue
Block a user