提交 80f990cb 编写于 作者: qian.jie's avatar qian.jie

上传图片添加限制

上级 2b32398c
......@@ -402,6 +402,7 @@ export default {
vm.$message.error("图片大小不符合规范,请根据规范上传图片 ");
return;
}
console.log(file.width, 'file.width');
let _img = new FileReader();
_img.readAsDataURL(file);
_img.onload = function (theFile) {
......@@ -409,6 +410,11 @@ export default {
image.src = theFile.target.result
image.onload = function () {
let _this = this;
if (_this.width != 650) {
vm.$message.info('图片尺寸不一致,无法提交!');
return;
}
console.log(_this.width);
openLoading(vm);
doUpload(vm, file, getFilePath(file, null), "preview4", "progress1", 1).then(function (path) {
closeLoading(vm);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册