本帖最后由 omar111 于 2022-5-7 09:29 编辑
报错信息- {error: 0, data: "", extend: {…}}
[Java] 纯文本查看 复制代码 xhr.onreadystatechange=function(){if(4==xhr.readyState){switch(xhr.status){case 200:var data={data};try{eval('data='+xhr.responseText);console.log(data);}catch(e){}
if(data&&data.error==0){$('#'+upfield).attr('src',data.extend.url).show();
$('#'+upfield+'1').attr('value',data.extend.url);
mui("#crop-dialog").popover("hide");callback&&window[callback](data);}else{mui.toast(data.data);}
break;default:mui.toast('上传失败,请重试');break;}
that.removeAttr('disabled');}};xhr.send(formPost);});
$('#crop-plus-btn').off('click').on('click',function(){window.cropObject.zoom(0.1);});$('#crop-dec-btn').off('click').on('click',function(){window.cropObject.zoom(-0.1);});$('#crop-rotate-btn').off('click').on('click',function(){window.cropObject.rotate(90);});var fileElement=false;var getInputFile=function(attr,onChange){if(!fileElement){try{fileElement=$('<input accept="image/*" type="file" style="opacity: 0;" /'+'>');$(document.body).append(fileElement);fileElement.on('click',function(){fileElement.val('');}).on('change',onChange);}catch(e){alert(e.number+'-'+e.message+':'+e.descrption+'(创建INPUT=File失败)');}} |