小学徒技术有限,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) { }
});
}
试过换其它方法但是技术不到位。
请专家帮忙修改
需要实现真机调试正常。