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