yh-client 2.0.10 → 2.0.12
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.
- package/index.es.js +51 -50
- package/index.es.js.map +1 -1
- package/package.json +1 -1
package/index.es.js
CHANGED
|
@@ -117,16 +117,16 @@ class Le {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
const U = new Le();
|
|
120
|
-
function
|
|
120
|
+
function Lx(B, d) {
|
|
121
121
|
return U.get(B, d);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function Ux(B, d) {
|
|
124
124
|
U.set(B, d);
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Nx(B) {
|
|
127
127
|
U.merge(B);
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Kx(B) {
|
|
130
130
|
U.init(B);
|
|
131
131
|
}
|
|
132
132
|
var I = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -5142,10 +5142,10 @@ function Cx() {
|
|
|
5142
5142
|
});
|
|
5143
5143
|
})(ve);
|
|
5144
5144
|
var Ex = ve.exports;
|
|
5145
|
-
async function
|
|
5145
|
+
async function jx(B) {
|
|
5146
5146
|
return Ex.MD5(B).toString();
|
|
5147
5147
|
}
|
|
5148
|
-
function
|
|
5148
|
+
function Mx(B) {
|
|
5149
5149
|
let d = 0;
|
|
5150
5150
|
for (let t = 0; t < B.length; t++) {
|
|
5151
5151
|
const r = B.charCodeAt(t);
|
|
@@ -5153,9 +5153,9 @@ function Kx(B) {
|
|
|
5153
5153
|
}
|
|
5154
5154
|
return Math.abs(d).toString(36);
|
|
5155
5155
|
}
|
|
5156
|
-
const
|
|
5156
|
+
const Xx = (B) => B.replace(/\_(\w)/g, function(d, t) {
|
|
5157
5157
|
return t.toUpperCase();
|
|
5158
|
-
}),
|
|
5158
|
+
}), Gx = () => {
|
|
5159
5159
|
const B = (/* @__PURE__ */ new Date()).getTime();
|
|
5160
5160
|
return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function(t) {
|
|
5161
5161
|
const r = (B + Math.random() * 16) % 16 | 0;
|
|
@@ -5170,7 +5170,7 @@ function px(B, d, t = window) {
|
|
|
5170
5170
|
const r = (a) => d(a.detail);
|
|
5171
5171
|
return t.addEventListener(B, r), () => t.removeEventListener(B, r);
|
|
5172
5172
|
}
|
|
5173
|
-
function
|
|
5173
|
+
function $x(B, d, t = window) {
|
|
5174
5174
|
const r = px(
|
|
5175
5175
|
B,
|
|
5176
5176
|
(a) => {
|
|
@@ -5180,11 +5180,11 @@ function Xx(B, d, t = window) {
|
|
|
5180
5180
|
);
|
|
5181
5181
|
return r;
|
|
5182
5182
|
}
|
|
5183
|
-
function
|
|
5183
|
+
function Zx(B, d, t = window) {
|
|
5184
5184
|
const r = (a) => d(a.detail);
|
|
5185
5185
|
t.removeEventListener(B, r);
|
|
5186
5186
|
}
|
|
5187
|
-
const
|
|
5187
|
+
const Yx = He, Qx = Se, Vx = Re;
|
|
5188
5188
|
class Ax {
|
|
5189
5189
|
constructor(d = "") {
|
|
5190
5190
|
this.timeout = 12e4, this.baseUrl = d, this.queue = {};
|
|
@@ -5425,7 +5425,7 @@ const D0 = new Ax(), g0 = "SATOKEN", _0 = "login-token";
|
|
|
5425
5425
|
function fe(B) {
|
|
5426
5426
|
return /^[\x20-\x7E]*$/.test(B);
|
|
5427
5427
|
}
|
|
5428
|
-
function
|
|
5428
|
+
function Jx() {
|
|
5429
5429
|
const B = E0(_0);
|
|
5430
5430
|
B && fe(B) ? U.token = B : (U.token = "", fr(_0));
|
|
5431
5431
|
const d = E0(g0);
|
|
@@ -5434,28 +5434,29 @@ function Qx() {
|
|
|
5434
5434
|
function Fx(B) {
|
|
5435
5435
|
ur(_0, B), U.token = B;
|
|
5436
5436
|
}
|
|
5437
|
-
function
|
|
5437
|
+
function Dx() {
|
|
5438
5438
|
if (U.token !== void 0)
|
|
5439
5439
|
return U.token;
|
|
5440
5440
|
const B = E0(_0);
|
|
5441
5441
|
return U.token = B || "", U.token;
|
|
5442
5442
|
}
|
|
5443
|
-
function
|
|
5443
|
+
function gx(B) {
|
|
5444
5444
|
ur(g0, B), U.saToken = B;
|
|
5445
5445
|
}
|
|
5446
|
-
function
|
|
5446
|
+
function _x() {
|
|
5447
5447
|
if (U.saToken !== void 0)
|
|
5448
5448
|
return U.saToken;
|
|
5449
5449
|
const B = E0(g0);
|
|
5450
5450
|
return U.saToken = B || "", U.saToken;
|
|
5451
5451
|
}
|
|
5452
|
-
function
|
|
5452
|
+
function bx() {
|
|
5453
5453
|
U.token = "", U.saToken = "", We();
|
|
5454
5454
|
}
|
|
5455
|
-
function
|
|
5456
|
-
|
|
5455
|
+
function yx() {
|
|
5456
|
+
bx();
|
|
5457
5457
|
}
|
|
5458
5458
|
const rt = ze("clientStore", () => {
|
|
5459
|
+
Dx(), _x();
|
|
5459
5460
|
const B = s0(""), d = s0(""), t = s0(""), r = s0(""), a = s0(!!U.token || !!U.saToken), h = s0(!!U.saToken);
|
|
5460
5461
|
return {
|
|
5461
5462
|
// 用户信息
|
|
@@ -5476,7 +5477,7 @@ const rt = ze("clientStore", () => {
|
|
|
5476
5477
|
return (s = x.data) != null && s.token && (Fx(x.data.token), a.value = !0, h.value = !1), x;
|
|
5477
5478
|
},
|
|
5478
5479
|
logout: async () => {
|
|
5479
|
-
|
|
5480
|
+
yx(), a.value = !1, h.value = !1, B.value = "", d.value = "", r.value = "";
|
|
5480
5481
|
},
|
|
5481
5482
|
getUserInfo: async () => {
|
|
5482
5483
|
const l = await D0.post("loginController/getUserInfo", {}, "json"), x = l.data;
|
|
@@ -5485,7 +5486,7 @@ const rt = ze("clientStore", () => {
|
|
|
5485
5486
|
saLogin: async (l) => {
|
|
5486
5487
|
var s;
|
|
5487
5488
|
const x = await D0.post("admin/login", l, "json");
|
|
5488
|
-
return (s = x.data) != null && s.token && (
|
|
5489
|
+
return (s = x.data) != null && s.token && (gx(x.data.token), a.value = !0, h.value = !0), x;
|
|
5489
5490
|
},
|
|
5490
5491
|
getSaUserInfo: async () => {
|
|
5491
5492
|
var s;
|
|
@@ -5494,9 +5495,9 @@ const rt = ze("clientStore", () => {
|
|
|
5494
5495
|
}
|
|
5495
5496
|
};
|
|
5496
5497
|
});
|
|
5497
|
-
var
|
|
5498
|
-
const
|
|
5499
|
-
function
|
|
5498
|
+
var kx = x0();
|
|
5499
|
+
const wx = /* @__PURE__ */ Ue(kx);
|
|
5500
|
+
function mx(B) {
|
|
5500
5501
|
const d = [], t = {}, r = {};
|
|
5501
5502
|
return B = JSON.parse(JSON.stringify(B)), B.forEach(function(a) {
|
|
5502
5503
|
a.parentId && a.parentId !== "0" && (r[a.parentId] || (r[a.parentId] = []), r[a.parentId].push(a)), a.children && a.children.length > 0 && a.children.forEach((h) => {
|
|
@@ -5509,7 +5510,7 @@ function kx(B) {
|
|
|
5509
5510
|
}), d;
|
|
5510
5511
|
}
|
|
5511
5512
|
function et(B, d = !1) {
|
|
5512
|
-
const t =
|
|
5513
|
+
const t = mx(B);
|
|
5513
5514
|
function r(a) {
|
|
5514
5515
|
if (["SUBPAGE", "JOIN", "APP"].includes(a.menuType || ""))
|
|
5515
5516
|
return !1;
|
|
@@ -5526,7 +5527,7 @@ function et(B, d = !1) {
|
|
|
5526
5527
|
h.id = `/sys/window/${a.windowId || a.id}`;
|
|
5527
5528
|
else if (a.url.indexOf("http") > -1) {
|
|
5528
5529
|
const y = "";
|
|
5529
|
-
h.id = `/iframe/${
|
|
5530
|
+
h.id = `/iframe/${wx(a.url)}?url=${encodeURIComponent(a.url)}&title=${a.name}&_keepAlive=${y}`;
|
|
5530
5531
|
} else
|
|
5531
5532
|
a.url.indexOf("/") !== 0 && (a.url = `/${a.url}`), h.id = a.url;
|
|
5532
5533
|
return a.children && (h.hasChildren = !0, h.children = a.children.map(r).filter((y) => !!y)), h;
|
|
@@ -5545,66 +5546,66 @@ function xt(B, d) {
|
|
|
5545
5546
|
}
|
|
5546
5547
|
const hr = "yh-menu-cache";
|
|
5547
5548
|
let C0 = null;
|
|
5548
|
-
function
|
|
5549
|
+
function Hx() {
|
|
5549
5550
|
if (C0)
|
|
5550
5551
|
return C0;
|
|
5551
5552
|
const B = E0(hr);
|
|
5552
5553
|
return B ? (C0 = B, B) : null;
|
|
5553
5554
|
}
|
|
5554
|
-
function
|
|
5555
|
+
function Sx(B) {
|
|
5555
5556
|
C0 = B, ur(hr, B);
|
|
5556
5557
|
}
|
|
5557
|
-
function
|
|
5558
|
+
function Rx() {
|
|
5558
5559
|
C0 = null, fr(hr);
|
|
5559
5560
|
}
|
|
5560
5561
|
async function tt(B = !1) {
|
|
5561
|
-
const d =
|
|
5562
|
+
const d = Hx();
|
|
5562
5563
|
if (d)
|
|
5563
5564
|
return d;
|
|
5564
5565
|
const r = (await Pe.post(
|
|
5565
5566
|
B ? "loginController/getPdaMenus" : "loginController/getMenus",
|
|
5566
5567
|
{}
|
|
5567
5568
|
)).data.data;
|
|
5568
|
-
return
|
|
5569
|
+
return Sx(r), r;
|
|
5569
5570
|
}
|
|
5570
5571
|
function nt() {
|
|
5571
|
-
|
|
5572
|
+
Rx();
|
|
5572
5573
|
}
|
|
5573
5574
|
export {
|
|
5574
5575
|
U as Config,
|
|
5575
5576
|
Ax as HttpRequest,
|
|
5576
5577
|
g0 as SA_TOKEN,
|
|
5577
5578
|
_0 as TOKEN_KEY,
|
|
5578
|
-
|
|
5579
|
+
yx as clearAllTokens,
|
|
5579
5580
|
nt as clearMenu,
|
|
5580
5581
|
We as clearStorage,
|
|
5581
|
-
|
|
5582
|
-
|
|
5582
|
+
bx as clearTokens,
|
|
5583
|
+
Yx as deepClone,
|
|
5583
5584
|
fr as delStorage,
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5585
|
+
Gx as generateId,
|
|
5586
|
+
jx as generateMd5Hash,
|
|
5587
|
+
Mx as generateSimpleHash,
|
|
5588
|
+
Lx as getConfig,
|
|
5588
5589
|
tt as getMenus,
|
|
5589
5590
|
xt as getRoutes,
|
|
5590
|
-
|
|
5591
|
+
_x as getSaToken,
|
|
5591
5592
|
E0 as getStorage,
|
|
5592
|
-
|
|
5593
|
+
Dx as getToken,
|
|
5593
5594
|
D0 as httpRequest,
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5595
|
+
Kx as initConfig,
|
|
5596
|
+
Jx as initTokens,
|
|
5597
|
+
Qx as isEqual,
|
|
5597
5598
|
et as menusToAside,
|
|
5598
|
-
|
|
5599
|
-
|
|
5599
|
+
Nx as mergeConfig,
|
|
5600
|
+
Zx as off,
|
|
5600
5601
|
px as on,
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5602
|
+
$x as once,
|
|
5603
|
+
Vx as overwriteObj,
|
|
5604
|
+
Ux as setConfig,
|
|
5605
|
+
gx as setSaToken,
|
|
5605
5606
|
ur as setStorage,
|
|
5606
5607
|
Fx as setToken,
|
|
5607
|
-
|
|
5608
|
+
Xx as toHump,
|
|
5608
5609
|
ce as trigger,
|
|
5609
5610
|
rt as useClientStore
|
|
5610
5611
|
};
|