前端发起请求路径没错报404解决方法
前端发起请求路径没错报404解决方法
·
var ajaxPost = {
url: "https://text/",
type: "post",
headers: {
"x-csrf-token": token,
"Content-Type": "application/json;charset=UTF-8",
},
data: operations,
xhrFields: {
withCredentials: true, //允许跨域带 Cookie
},
success: function (html) {
console.log("成功");
window.location.reload();
return { success: true, message: "自动新增地址成功" };
},
error: function (e) {},
};
$.ajax(ajaxPost);
1.检查请求有没默认带上请求头
2.检查有没携带上cookie
更多推荐
已为社区贡献2条内容
所有评论(0)