谁用这玩意啊...服了
画了一个小时总结:
1. 他的url 不能用 127.0.0.1 已经 loaclhosy 只能用自己本机IP ,自己IPconfig 查询
2.他的url一定要带上http://协议头。http 和 https都可以
以上2点没满足!那么就等这回调error错误把,而且没任何提示! 气死人!!!!!!!!!!
刚成功的代码:
mui.ajax(app.serverUrl + "/u/login", {
data: {
"username": username.value,
"password": txt_password.value,
"cid": cid
},
dataType: 'json',
type: 'post', //HTTP请求类型
timeout: 10000, //超时时间设置为10秒;
headers: {
'Content-Type': 'application/json'
},
success: function(data) {
console.log(JSON.stringify(data));
}
})
mui.axaj
作者:咸瑜