Browse Source

修改品牌图片限制

dev-xx
qb 8 months ago
parent
commit
002051f893
  1. 10
      src/views/basicdata/brand/basicBrand.vue

10
src/views/basicdata/brand/basicBrand.vue

@ -390,16 +390,18 @@ export default {
this.form.brandIcon = res.data.link;
},
beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg';
const isJPEG = file.type === 'image/jpeg';
const isJPG = file.type === 'image/jpg';
const isPNG = file.type === 'image/png';
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG) {
this.$message.error('上传头像图片只能是 JPG 格式!');
if (!isJPEG && !isJPG && !isPNG) {
this.$message.error('上传头像图片是 JPG | JPEG | PNG 格式!');
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!');
}
return isJPG && isLt2M;
return (isJPG || isJPEG || isPNG) && isLt2M;
},
uploadSuccess(fileList) {
console.log('123123123', fileList);

Loading…
Cancel
Save