个人头像为图片服务器跨域问题

dep_wangsr
RuoYi 6 years ago committed by Limy
parent bfdaf0ef3c
commit 8af0ff1054

@ -123,6 +123,7 @@
$(window).bind('mouseup', imgMouseUp); $(window).bind('mouseup', imgMouseUp);
el.bind('mousewheel DOMMouseScroll', zoomImage); el.bind('mousewheel DOMMouseScroll', zoomImage);
}; };
obj.image.crossOrigin = 'Anonymous';
obj.image.src = options.imgSrc; obj.image.src = options.imgSrc;
el.on('remove', function(){$(window).unbind('mouseup', imgMouseUp)}); el.on('remove', function(){$(window).unbind('mouseup', imgMouseUp)});

@ -38,7 +38,7 @@ $(window).load(function() {
options.imgSrc = e.target.result; options.imgSrc = e.target.result;
//根据MIME判断上传的文件是不是图片类型 //根据MIME判断上传的文件是不是图片类型
if((options.imgSrc).indexOf("image/")==-1){ if((options.imgSrc).indexOf("image/")==-1){
$.modal.alertWarning("文件格式错误,请上传图片类型,如JPG,JEPGPNG后缀的文件。"); $.modal.alertWarning("文件格式错误,请上传图片类型,如JPG,JPEGPNG后缀的文件。");
} else { } else {
cropper = $('.imageBox').cropbox(options); cropper = $('.imageBox').cropbox(options);
} }

Loading…
Cancel
Save