52,785
社区成员
发帖
与我相关
我的任务
分享$.ajax({
type: "post",
url: "http://www.xuedao99.com/api/index.php/user/login",
async: true,
headers:{"Content-Type":"application/x-www-form-urlencoded","Origin": "*"},
dataType: "json",
data : {
username: document.getElementById("account").value,
password: document.getElementById("password").value
},
success: function(data) {
alert(123);
if (data.status == 1) {
mui.openWindow({
id: 'html/home.html',
url: 'html/home.html',
extras: {
userId:"11"
},
});
} else {
document.getElementById("mask").style.display = "none";
mui.toast("用户名或密码错误");
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
}
});