添加上传图片文件的验证
This commit is contained in:
@ -96,6 +96,10 @@ export default {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
beforeUpload(file) {
|
||||
if (file.type.indexOf('image/') == -1) {
|
||||
this.msgError('文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。');
|
||||
return false;
|
||||
}
|
||||
// const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1);
|
||||
// const whiteList = ['pdf', 'doc', 'docx', 'xls', 'xlsx'];
|
||||
// if (whiteList.indexOf(fileSuffix) === -1) {
|
||||
|
Reference in New Issue
Block a user