$.ajax({
url: "url",
type: "POST",
async: true,
data: {},
dataType: "json",
xhrFields: { withCredentials: true },//跨域的设置
success: function (res) {
console.log(res)
},
error: function (xhr, ajaxOptions, thrownError) {
console.info("error.");
}
});