@glodon-aiot/react-biz-components 3.0.5-beta.1 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -48455,7 +48455,7 @@ class pH {
|
|
|
48455
48455
|
// https://github.com/axios/axios#handling-errors
|
|
48456
48456
|
handleError(e) {
|
|
48457
48457
|
var r, n;
|
|
48458
|
-
return e.response ? (
|
|
48458
|
+
return e.response ? (r = this.errorHandler) != null && r.onHttpStatusError && (console.log("HTTP 错误", this.errorHandler), this.errorHandler.onHttpStatusError(e.response.status, "", e.response)) : e.request ? (console.log(e.request), (n = this.errorHandler) != null && n.onNetworkError && this.errorHandler.onNetworkError()) : console.error("axios request config error:", e), new Error(e.message);
|
|
48459
48459
|
}
|
|
48460
48460
|
}
|
|
48461
48461
|
const PEt = (t) => t >= 10002 && t <= 10012, REt = (t, e) => PEt(t) ? "数据操作错误" : e || "未知接口错误";
|
|
@@ -76253,7 +76253,6 @@ const QEt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
|
|
76253
76253
|
let Eu = "";
|
|
76254
76254
|
const Wu = {
|
|
76255
76255
|
setToken: (t) => {
|
|
76256
|
-
console.log("setToken", t);
|
|
76257
76256
|
debugger;
|
|
76258
76257
|
const e = Yu(t).ten || "_", r = window.location.pathname.split("/")[3];
|
|
76259
76258
|
Eu = window.location.hostname !== "localhost" ? `${e}.${r}.u` : "u", window.localStorage.setItem(Eu, t);
|
|
@@ -79642,11 +79641,11 @@ const Dn = {
|
|
|
79642
79641
|
}
|
|
79643
79642
|
}, a_t = (t, e, r) => {
|
|
79644
79643
|
var n;
|
|
79645
|
-
return !((n = Dn.user) === null || n === void 0) && n.token ?
|
|
79644
|
+
return !((n = Dn.user) === null || n === void 0) && n.token ? lg.postRefreshToken(Dn.user.token, t, e || "", void 0, r).then((i) => {
|
|
79646
79645
|
debugger;
|
|
79647
79646
|
const s = Yu(i.token), a = s == null ? void 0 : s.exp, l = s == null ? void 0 : s.ro, c = s == null ? void 0 : s.ten, p = s == null ? void 0 : s.uid, h = s == null ? void 0 : s.oid, g = { token: i.token, exp: a, ten: c, ro: l, uid: p, oid: h };
|
|
79648
79647
|
return Wu.setToken(i.token), Dn.user = g, i.token;
|
|
79649
|
-
})
|
|
79648
|
+
}) : Promise.reject({ status: 401, massage: "当前用户token不存在" });
|
|
79650
79649
|
};
|
|
79651
79650
|
function f_t({ children: t }) {
|
|
79652
79651
|
const [e, r] = mr(!0), [n, i] = mr(null), [s, a] = mr(null), [l, c] = mr(), p = (x) => {
|
|
@@ -79702,10 +79701,10 @@ function f_t({ children: t }) {
|
|
|
79702
79701
|
Dn.setLoginAdrress(x);
|
|
79703
79702
|
}, M = (x, E, _) => {
|
|
79704
79703
|
var S;
|
|
79705
|
-
return !((S = Dn.user) === null || S === void 0) && S.token ?
|
|
79704
|
+
return !((S = Dn.user) === null || S === void 0) && S.token ? a_t(x, E, _).then((C) => {
|
|
79706
79705
|
const N = Yu(C), T = N == null ? void 0 : N.exp, A = N == null ? void 0 : N.ro, j = N == null ? void 0 : N.ten, k = N == null ? void 0 : N.uid, P = N == null ? void 0 : N.oid, z = { token: C, exp: T, ten: j, ro: A, uid: k, oid: P };
|
|
79707
79706
|
return i(z), Wu.setToken(C), Dn.user = z, C;
|
|
79708
|
-
})
|
|
79707
|
+
}) : Promise.reject({ status: 401, massage: "当前用户token不存在" });
|
|
79709
79708
|
}, b = {
|
|
79710
79709
|
loading: e,
|
|
79711
79710
|
signin: g,
|