From d502e46f8f7ef45dec3ba08e37ad53a8c3e734a1 Mon Sep 17 00:00:00 2001 From: pzy Date: Thu, 24 Feb 2022 10:50:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0-=E5=B0=BA?= =?UTF-8?q?=E5=AF=B8=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/get-img-width.js | 9 +++++---- src/views/ad/index.vue | 21 +++++++++++++++++++-- src/views/article/index.vue | 20 +++++++++++++++++--- 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/src/utils/get-img-width.js b/src/utils/get-img-width.js index 73ae9b0..1a29234 100644 --- a/src/utils/get-img-width.js +++ b/src/utils/get-img-width.js @@ -43,17 +43,18 @@ export default function (file, id) { // console.log(id, width, height); if (width && height) { if (img.width === width && img.height === height) { - resolve(true) + resolve({ validation: true }) } else { Message({ - message: `图片上传失败,宽高错误`, + message: `图片上传失败,宽高错误。正确尺寸${width}x${height}`, type: "warning", duration: 5000 }); - resolve(false); + let res = { width, height, validation: false } + resolve(res); } } else { - resolve(true) + resolve({ validation: true }) } }; }; diff --git a/src/views/ad/index.vue b/src/views/ad/index.vue index ba064cf..15e3b74 100644 --- a/src/views/ad/index.vue +++ b/src/views/ad/index.vue @@ -151,6 +151,12 @@ > +
+ 提示:宽高{{ dislabelSize.width }}x{{ dislabelSize.height }} +