mui.ajax(path,{ajax
//传入的参数json
data: {
token:token,
gnbh:gnbh
},
dataType:'json',//服务器返回json格式数据
type:'post',//HTTP请求类型
timeout:30000,//超时时间设置为30秒;
服务器
success:function(data){post
//code是根据后台返回来的数据决定的ui
if(data.code=='success'){
}
}else{
mui.toast(data.message);
}
},
error:function(xhr,type,errorThrown){
//异常处理;
mui.toast('服务器异常登陆失败!');
}
});
spa