求微信小程序与PHP服务器交互专家,修改交互的逻辑

小学徒技术有限,3年前开发的小程序,由于官方升级更新后以前的授权连接方式变化了。现在可以开发工具实现交互,上真机就不行。现在报错cookie的get_sessionid有错误。报渲染层错误。
[渲染层网络层错误] Failed to load font http://at.alicdn.com/t/font_409135_swxls4dlirjp2e29.ttf
net::ERR_CACHE_MISS
(env: Windows,mp,1.05.2204180; lib: 2.14.0)

function e() {
var e = new Date();
e.setHours(0), e.setMinutes(0), e.setSeconds(0), e.setMilliseconds(0), e = e.getTime() / 1e3;
var t = "", a = {};
return t = o.default.hexMD5(e + n.fixStr), a.sign = t, a;
}

function t(e) {
    var t = new Date();
    t.setHours(0), t.setMinutes(0), t.setSeconds(0), t.setMilliseconds(0), t = t.getTime() / 1e3;
    var a = "", r = {};
    return "" == e.param ? a = o.default.hexMD5(t + n.fixStr) : (a = o.default.hexMD5(e.path.split("Api/")[1] + t + n.fixStr), 
    r = e.param), r.sign = a, r;
}

var o = function(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}(require("./md5.js")), n = {
    url: "https://www.rieasen.com/",
    fixStr: "luoluo415dsfd328fdf9843rgdyfu7ytfhb383"
};

export function request(o, a, r, i) {
  var s = wx.getStorageSync("PHPSESSID"), l = this;
  if (s) {
    if ("" != (s = "string" == typeof s ? s : s[0]) && null != s)
      u = {
        "content-type": "application/x-www-form-urlencoded",
        Cookie: s
      }; else
      var u = {
        "content-type": "application/x-www-form-urlencoded"
      };
    this.methodStr = i || "POST", this.path = o || "", this.param = a || "", wx.request({
      url: n.url + this.path,
      data: t(this),
      header: u,
      method: this.methodStr.toUpperCase() || "POST",
      dataType: "json",
      success: function (e) {
        "" != s && null != s || !e.header || s || wx.setStorageSync("PHPSESSID", e.header["Set-Cookie"]),
          r && "function" == typeof r && r(e);
      },
      fail: function (e) {
        console.log("err");
      },
      complete: function (e) { }
    });
  } else
    wx.request({
      url: n.url + "Api/Index/get_sessionid",
      data: e(),
      header: {
        "content-type": "application/x-www-form-urlencoded"
      },
      method: "POST",
      dataType: "json",
      success: function (e) {
        if (1 == e.data.code && (s = "PHPSESSID=" + e.data.data.sid + "; path=/", wx.setStorageSync("PHPSESSID", s)),
          "" != s && null != s)
          u = {
            "content-type": "application/x-www-form-urlencoded",
            Cookie: s
          }; else
          var u = {
            "content-type": "application/x-www-form-urlencoded"
          };
        l.methodStr = i || "POST", l.path = o || "", l.param = a || "", wx.request({
          url: n.url + l.path,
          
          data: t(l),
          header: u,
          method: l.methodStr.toUpperCase() || "POST",
          dataType: "json",
          success: function (e) {
            "" != s && null != s || !e.header || s || wx.setStorageSync("PHPSESSID", e.header["Set-Cookie"]),
              r && "function" == typeof r && r(e);
          },
          fail: function (e) {
            console.log("err");
          },
          complete: function (e) { }
        });
      },
      fail: function (e) {
        console.log("err");
      },
      complete: function (e) { }
    });
}
export function upload(e, o, a, r) {
  var i = wx.getStorageSync("PHPSESSID");
  if ("" != i && null != i)
    s = {
      "Content-Type": "multipart/form-data",
      Cookie: i
    }; else
    var s = {
      "Content-Type": "multipart/form-data"
    };
  this.path = e || "", this.param = a || "", wx.uploadFile({
    url: n.url + this.path,
    filePath: o,
    name: "photos",
    header: s,
    formData: t(this),
    success: function (e) {
      "" != i && null != i || !e.header || i || wx.setStorageSync("PHPSESSID", e.header["Set-Cookie"]),
        r && "function" == typeof r && r(e);
    },
    fail: function (e) {
      console.log(e);
    },
    complete: function (e) { }
  });
}

img

试过换其它方法但是技术不到位。
请专家帮忙修改

需要实现真机调试正常。

1.更新你的微信开发工具到比较新的版本
2.使用真机调试 查看报错日志
3.定位问题 修改代码 调试

如果可以的话 我可以给你在线修改

Failed to load font http://at.alicdn.com/t/font_409135_swxls4dlirjp2e29.ttf 这个报错看起来是字体文本加载失败,换成https试试

报错是跨域了,跨域操作cookie是不容许的。尝试一下请求页面和接口能否再一个域名下。

现在碰上这类问题,我得先问朋友一句,你的这个微信小程序是在哪开发的,用的vue还是微信开发者工具?

添加允许跨域请求就行,如果域名不是你们自己,就把文件迁移到你们服务器里
header("Access-Control-Allow-Origin: *");//允许所有地址跨域请求

这个招人做吧

微信小程序不支持COOKIE,用setStorage或者setStorageSync。
还可以考虑中间件储存统一信息,比如redis。

微信小程序开发工具里面不是有一个忽略https校验吗?取消勾选即可