ajxc的数据必须包含以下部分
url:目标路径,type:请求方法,dataType:数据类型,data:参数数据
如果成功则返回,success: function (res) { }
<script>
$(function () {
$("#login").click(function () {
//console.log("");
var acctID = $("#acctID").val();
var username = $("#username").val();
var password = $("#password").val();
var lcid = $("#lcid").val();
$.ajax({
url: 'http://desktop-
ur9tsgr/k3cloud/
Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc',
type: 'POST',
dataType: 'json',
data: {
acctID,
username,
password,
lcid
},
success: function (res) {
console.log("成功");
console.log(res);
if (res.IsSuccessByAPI == true) {
window.location="./table.html";
}
}
})
});
});
</script>
json数据格式:
{
"Tables":[
{
"Name":"Table",
"Rows":[
{
"FID":"100001",
"FBILLNO":"LQ202106100001",
"FDOCUMENTSTATUS":"A",
"F_DEV_GRADE":"220",
"F_DEV_STARTTIME":"2021-06-1000: 00: 00",
"F_DEV_ENDTTME":"2021-06-1000: 00: 00",
"F_DEV_Y":"是"
},
{
"FID":"100005",
"FBILLNO":"LQ202106170001",
"FDOCUMENTSTATUS":"A",
"F_DEV_GRADE":"30",
"F_DEV_STARTTIME":"2021-06-1700: 00: 00",
"F_DEV_ENDTTME":"2021-06-2200: 00: 00",
"F_DEV_Y":"是"
},
{
"FID":"100007",
"FBILLNO":"LQ202106090001",
"FDOCUMENTSTATUS":"A",
"F_DEV_GRADE":"40",
"F_DEV_STARTTIME":"2021-06-0900: 00: 00",
"F_DEV_ENDTTME":"2021-06-1600: 00: 00",
"F_DEV_Y":"是"
},
{
"FID":"100021",
"FBILLNO":"LQ0012",
"FDOCUMENTSTATUS":"A",
"F_DEV_GRADE":"0",
"F_DEV_STARTTIME":"",
"F_DEV_ENDTTME":"",
"F_DEV_Y":"否"
}
]
}
]
}