From 5096b2267ce3d55dab72388bca820187d97bc1b3 Mon Sep 17 00:00:00 2001 From: yangzhengze <1403014932@qq.com> Date: Thu, 31 May 2018 17:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=94=B9=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E5=A4=B4=E5=83=8F=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=99=90=E5=AE=9A=E4=B8=BA=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/system/user/profile/avatar.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/system/user/profile/avatar.html b/src/main/resources/templates/system/user/profile/avatar.html index a3b017068..226024593 100644 --- a/src/main/resources/templates/system/user/profile/avatar.html +++ b/src/main/resources/templates/system/user/profile/avatar.html @@ -13,7 +13,7 @@
- +
@@ -37,7 +37,12 @@ $(window).load(function() { var reader = new FileReader(); reader.onload = function(e) { options.imgSrc = e.target.result; - cropper = $('.imageBox').cropbox(options); + //根据MIME判断上传的文件是不是图片类型 + if((options.imgSrc).indexOf("image/")==-1){ + alert("错误提示\n" + " 请上传图片类型!"); + } else { + cropper = $('.imageBox').cropbox(options); + } } reader.readAsDataURL(this.files[0]); })