$.ajax({
type: "POST",
url: "/Login/Loginin",
contentType: "application/json;charset=utf-8",
data: JSON.stringify(data),
dataType: "json",
success:function (message) {
if (message.code == 200) {
layer.msg('登錄成功', function () {
window.location = '/main.html';
return true;
});
}else {
layer.msg('登錄失敗'+JSON.stringify(message.message), function () {
return false;
});
}
},
error:function (message) {
alert("提交失敗"+JSON.stringify(message));
return false;
}
});
JSON.stringify(data)將對象序列化成json