我现在调用了公司的登录接口,为什么不能登录呢?请各位大佬们不吝赐教
login.addEventListener('tap', function() {
var username = document.getElementById("username");
var password = document.getElementById("password");
if(username.value.length == 0) {
plus.ui.toast("用户名不能为空");
return;
}
if(!(username.value.match(/^1(3|4|5|7|8)\d{9}$/))) {
plus.ui.toast('请输入有效的手机号码');
return;
}
if(password.value.length == 0) {
plus.ui.toast("密码不能为空");
return;
}
mui.ajax('http://app.mm.com/index.php?username=17729835346&password=123456', {
data: {
username: username.value,
password: password.value,
},
dataType: 'json',
type: 'POST',
timeout: 10000,
success: function(data) {
//{"reslut":1}
if(data.result == 1) {
//登录成功
plus.ui.toast("登录成功");
mui.openWindow({
url: 'deng.html',
id: 'deng',
})
} else {
//登录失败
plus.ui.toast(data.data);
}
},
error: function() {}
})
})
1***@qq.com (作者)
你是说我路径有问题是吧
2017-12-05 11:29
2***@qq.com
mui.ajax('http://app.mm.com/index.php?username=17729835346&password=123456',
?后面的去掉
2017-12-05 13:49
1***@qq.com (作者)
我已经解决了
2017-12-05 14:54
2***@qq.com
OK
2017-12-05 15:07