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

 

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐