diff --git a/src/main/resources/templates/system/user/profile/avatar.html b/src/main/resources/templates/system/user/profile/avatar.html index a3b01706..22602459 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]); })