代码:
//与后端进行连接
mui.ajax('http://liupeng.nat300.top/u/registOrLogin',{
data: {
username: "dddd",
password: "asssss"
},
dataType:'json',//服务器返回json格式数据
type:'post',//HTTP请求类型
timeout:10000,//超时时间设置为10秒;
headers:{'Content-Type':'application/json'},
success:function(data){
console.log(JSON.stringify(data));
//服务器返回响应,根据响应结果,分析是否登录成功;
if(data.status == 200){
alert(ok);
}else{
app.showToast(data.msg,"error");
}
},
error:function(xhr,type,errorThrown){
//异常处理;
console.log(type);
console.log(errorThrown);
}
});
手机和 电脑用的同一个网段,
hbuilder的日志显示:[WARNING:] [MENU] !!!Can't find the action id: "workbench.action.testExpr"
后端没有任何反应
1 个回复
7***@qq.com
改成jquery的ajax试试,是你的后端接口有问题,还是你mui的ajax写的有问题?