Ajax 请求格式
function clickFun() { $.ajax({ url: "http://localhost:8088/user/get-level-users?level=1", type: "GET", headers: { "X-Requested-With": XMLHttpRequest }, success:function(result){ console.log(result) }, error:function(error){ console.log("error", error) } }); } function postMethodFun(){ $.ajax({ url: Feng.ctxPath + "/authentication/approval", type: "POST", data: JSON.stringify(data), contentType:"application/json", dataType : "json", success:function(result){ console.log(result) }, error:function(error){ console.log("error", error) } }); }