格式
$.ajax({
url:' ', //地址
type:' ', //请求的方式
data: , //传递的参数
complete:function(com){
}, //完成的回调函数
success:function(res){
}, //成功的回调函数
error: function (error) {
}, //失败的返回函数
contentType: //请求头
})
使用
$.ajax({
url: "http://1.117.81.216:8087/weChat/applet/subject/list",
type: 'post',
data: JSON.stringify({ enable: 1 }),
contentType: 'application/json',
success: function (res) {
console.log(res);
}
})