mgacn-commonsdk 1.1.9 → 1.2.0
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/dist/{_plugin-vue_export-helper-BQvqIi3R.js → _plugin-vue_export-helper-Bp7fC9dg.js} +143 -129
- package/dist/mgacn-admin.js +1102 -1048
- package/dist/mgacn-commonsdk.js +837 -788
- package/dist/style.css +2 -2
- package/package.json +1 -1
package/dist/{_plugin-vue_export-helper-BQvqIi3R.js → _plugin-vue_export-helper-Bp7fC9dg.js}
RENAMED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import U from "axios";
|
|
2
|
-
const
|
|
3
|
-
function G(t) {
|
|
4
|
-
globalThis[A] = t == null ? "" : String(t);
|
|
5
|
-
}
|
|
6
|
-
function N() {
|
|
7
|
-
return globalThis[A] || "";
|
|
8
|
-
}
|
|
2
|
+
const M = "__MGACN_COMMONSDK_SYSTEM_ID__", D = "__MGACN_COMMONSDK_USER_ID__";
|
|
9
3
|
function F(t) {
|
|
10
4
|
globalThis[M] = t == null ? "" : String(t);
|
|
11
5
|
}
|
|
12
|
-
function
|
|
6
|
+
function S() {
|
|
13
7
|
return globalThis[M] || "";
|
|
14
8
|
}
|
|
9
|
+
function G(t) {
|
|
10
|
+
globalThis[D] = t == null ? "" : String(t);
|
|
11
|
+
}
|
|
12
|
+
function H() {
|
|
13
|
+
return globalThis[D] || "";
|
|
14
|
+
}
|
|
15
15
|
function K(t = {}) {
|
|
16
16
|
const {
|
|
17
17
|
baseURL: e = "",
|
|
@@ -21,25 +21,25 @@ function K(t = {}) {
|
|
|
21
21
|
userId: s,
|
|
22
22
|
loginUrl: l = "/login"
|
|
23
23
|
} = t;
|
|
24
|
-
i != null && i !== "" &&
|
|
25
|
-
const
|
|
24
|
+
i != null && i !== "" && F(i), s != null && s !== "" && G(s);
|
|
25
|
+
const a = U.create({ baseURL: e, timeout: n });
|
|
26
26
|
let f = !1;
|
|
27
|
-
function
|
|
27
|
+
function c() {
|
|
28
28
|
typeof localStorage < "u" && localStorage.clear(), !f && (f = !0, setTimeout(() => {
|
|
29
29
|
typeof window < "u" && window.location.replace(l);
|
|
30
30
|
}, 1500));
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return a.interceptors.request.use(
|
|
33
33
|
(o) => {
|
|
34
34
|
if (o.headers["Content-Type"] = "application/json;charset=UTF-8", typeof localStorage < "u" && r) {
|
|
35
35
|
const m = localStorage.getItem(r);
|
|
36
36
|
m && (o.headers.Authorization = m);
|
|
37
37
|
}
|
|
38
|
-
const u =
|
|
38
|
+
const u = S();
|
|
39
39
|
return u && (o.headers.systemId = u), o;
|
|
40
40
|
},
|
|
41
41
|
(o) => Promise.reject(o)
|
|
42
|
-
),
|
|
42
|
+
), a.interceptors.response.use(
|
|
43
43
|
(o) => {
|
|
44
44
|
if (o.status !== 200)
|
|
45
45
|
return Promise.reject(new Error(`请求发生错误,状态码 ${o.status}`));
|
|
@@ -47,23 +47,23 @@ function K(t = {}) {
|
|
|
47
47
|
if (m.responseType === "arraybuffer" || m.responseType === "blob")
|
|
48
48
|
return u;
|
|
49
49
|
if (u && u.code === 0) return u.data;
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
return
|
|
53
|
-
const
|
|
54
|
-
return
|
|
50
|
+
const y = Number(u == null ? void 0 : u.code);
|
|
51
|
+
if (y === 401 || y === 403)
|
|
52
|
+
return c(), Promise.reject(new Error("登录失效,请重新登录"));
|
|
53
|
+
const N = A(u) || "请求失败", g = new Error(N);
|
|
54
|
+
return g.code = y, g.data = u == null ? void 0 : u.data, g.biz = u, Promise.reject(g);
|
|
55
55
|
},
|
|
56
56
|
(o) => {
|
|
57
|
-
var
|
|
58
|
-
const u = (
|
|
57
|
+
var N, g;
|
|
58
|
+
const u = (N = o == null ? void 0 : o.response) == null ? void 0 : N.status;
|
|
59
59
|
if (u === 401 || u === 403)
|
|
60
|
-
return
|
|
61
|
-
const m = (
|
|
62
|
-
return Promise.reject(new Error(String(
|
|
60
|
+
return c(), Promise.reject(new Error("登录失效,请重新登录"));
|
|
61
|
+
const m = (g = o == null ? void 0 : o.response) == null ? void 0 : g.data, y = A(m) || (o == null ? void 0 : o.message) || "请求失败";
|
|
62
|
+
return Promise.reject(new Error(String(y)));
|
|
63
63
|
}
|
|
64
|
-
),
|
|
64
|
+
), a;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function A(t) {
|
|
67
67
|
if (t == null) return "";
|
|
68
68
|
if (typeof t == "string") {
|
|
69
69
|
const n = t.trim();
|
|
@@ -78,7 +78,7 @@ function E(t) {
|
|
|
78
78
|
}
|
|
79
79
|
return "";
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function dt(t = {}) {
|
|
82
82
|
const e = K(t);
|
|
83
83
|
return {
|
|
84
84
|
GET(n, r = {}) {
|
|
@@ -92,12 +92,12 @@ function mt(t = {}) {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
const
|
|
96
|
-
function
|
|
97
|
-
globalThis[
|
|
95
|
+
const P = "__MGACN_COMMONSDK_REQUEST__";
|
|
96
|
+
function gt(t) {
|
|
97
|
+
globalThis[P] = t;
|
|
98
98
|
}
|
|
99
99
|
function L() {
|
|
100
|
-
const t = globalThis[
|
|
100
|
+
const t = globalThis[P];
|
|
101
101
|
if (!t)
|
|
102
102
|
throw new Error("[mgacn-commonsdk] 请先 app.use(MgacnCommonSdk, { tokenKey, baseURL })");
|
|
103
103
|
return t;
|
|
@@ -107,11 +107,11 @@ function $(t, e, n = "application/vnd.ms-excel") {
|
|
|
107
107
|
const r = t instanceof Blob ? t : new Blob([t], { type: n }), i = window.URL.createObjectURL(r), s = document.createElement("a");
|
|
108
108
|
s.href = i, s.download = e || "download", s.style.display = "none", document.body.appendChild(s), s.click(), document.body.removeChild(s), window.URL.revokeObjectURL(i);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function b(t) {
|
|
111
111
|
return String(t).padStart(2, "0");
|
|
112
112
|
}
|
|
113
113
|
function B(t = /* @__PURE__ */ new Date()) {
|
|
114
|
-
return `${t.getFullYear()}${
|
|
114
|
+
return `${t.getFullYear()}${b(t.getMonth() + 1)}${b(t.getDate())}${b(t.getHours())}${b(t.getMinutes())}${b(t.getSeconds())}`;
|
|
115
115
|
}
|
|
116
116
|
async function q(t) {
|
|
117
117
|
if (!(t instanceof Blob) || !t.type || !/json/i.test(t.type)) return;
|
|
@@ -135,13 +135,13 @@ async function z(t = {}) {
|
|
|
135
135
|
} = t;
|
|
136
136
|
if (!e) throw new Error("导出地址不能为空");
|
|
137
137
|
if (!s) throw new Error("导出文件名不能为空");
|
|
138
|
-
const
|
|
139
|
-
let
|
|
140
|
-
f === "GET" ?
|
|
138
|
+
const a = L(), f = String(i).toUpperCase();
|
|
139
|
+
let c;
|
|
140
|
+
f === "GET" ? c = await a.GET(e, { params: r, responseType: "blob" }) : c = await a.POST(e, n, { responseType: "blob" }), await q(c);
|
|
141
141
|
const u = /\.[a-z0-9]+$/i.test(s) ? s : `${s}_${B()}.${l}`;
|
|
142
|
-
return $(
|
|
142
|
+
return $(c, u), u;
|
|
143
143
|
}
|
|
144
|
-
let
|
|
144
|
+
let d = null, p = null;
|
|
145
145
|
function k(t, e) {
|
|
146
146
|
if (!t || e == null || e === "") return !1;
|
|
147
147
|
if (typeof e == "object")
|
|
@@ -150,39 +150,45 @@ function k(t, e) {
|
|
|
150
150
|
return t.id != null && String(t.id) === n || String(t.platformName || "") === n;
|
|
151
151
|
}
|
|
152
152
|
function Y(t) {
|
|
153
|
-
|
|
153
|
+
d = Array.isArray(t) ? t : [];
|
|
154
154
|
}
|
|
155
155
|
function Q() {
|
|
156
|
-
|
|
156
|
+
d = null, p = null;
|
|
157
157
|
}
|
|
158
158
|
function X(t) {
|
|
159
|
-
if (!Array.isArray(
|
|
160
|
-
const e =
|
|
159
|
+
if (!Array.isArray(d) || !d.length) return "";
|
|
160
|
+
const e = d.find((n) => k(n, t));
|
|
161
161
|
return (e == null ? void 0 : e.platformLogo) || "";
|
|
162
162
|
}
|
|
163
163
|
async function J() {
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
return d ?? (p || (p = (async () => {
|
|
165
|
+
try {
|
|
166
|
+
const t = await at().listPlatformInfoAll();
|
|
167
|
+
return Y(t), d;
|
|
168
|
+
} finally {
|
|
169
|
+
p = null;
|
|
170
|
+
}
|
|
171
|
+
})(), p));
|
|
166
172
|
}
|
|
167
173
|
function I(t) {
|
|
168
174
|
const e = String(t || "").trim().toUpperCase();
|
|
169
175
|
if (/^\d{15}$/.test(e)) {
|
|
170
|
-
const
|
|
171
|
-
return m.getFullYear() ===
|
|
176
|
+
const c = +`19${e.slice(6, 8)}`, o = Number(e.slice(8, 10)), u = Number(e.slice(10, 12)), m = new Date(c, o - 1, u);
|
|
177
|
+
return m.getFullYear() === c && m.getMonth() + 1 === o && m.getDate() === u;
|
|
172
178
|
}
|
|
173
179
|
if (!/^\d{17}[\dX]$/.test(e)) return !1;
|
|
174
180
|
const n = Number(e.slice(6, 10)), r = Number(e.slice(10, 12)), i = Number(e.slice(12, 14)), s = new Date(n, r - 1, i);
|
|
175
181
|
if (s.getFullYear() !== n || s.getMonth() + 1 !== r || s.getDate() !== i) return !1;
|
|
176
|
-
const l = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2],
|
|
182
|
+
const l = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2], a = "10X98765432";
|
|
177
183
|
let f = 0;
|
|
178
|
-
for (let
|
|
179
|
-
return
|
|
184
|
+
for (let c = 0; c < 17; c++) f += Number(e[c]) * l[c];
|
|
185
|
+
return a[f % 11] === e[17];
|
|
180
186
|
}
|
|
181
187
|
function O(t) {
|
|
182
188
|
const e = String(t || "").trim().replace(/\s+/g, "");
|
|
183
189
|
return e ? /^1\d{10}$/.test(e) || /^\+[1-9]\d{6,14}$/.test(e) : !1;
|
|
184
190
|
}
|
|
185
|
-
function
|
|
191
|
+
function C(t) {
|
|
186
192
|
const e = String(t || "").trim();
|
|
187
193
|
return e ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) : !1;
|
|
188
194
|
}
|
|
@@ -216,7 +222,7 @@ function W(t, e, n) {
|
|
|
216
222
|
n();
|
|
217
223
|
return;
|
|
218
224
|
}
|
|
219
|
-
if (!
|
|
225
|
+
if (!C(e)) {
|
|
220
226
|
n(new Error("请输入正确的邮箱"));
|
|
221
227
|
return;
|
|
222
228
|
}
|
|
@@ -225,13 +231,13 @@ function W(t, e, n) {
|
|
|
225
231
|
function v(t) {
|
|
226
232
|
return !!(t == null || typeof t == "string" && t.trim() === "" || Array.isArray(t) && t.length === 0 || typeof t == "object" && !Array.isArray(t) && Object.keys(t).length === 0);
|
|
227
233
|
}
|
|
228
|
-
function
|
|
234
|
+
function T(t) {
|
|
229
235
|
if (t === null || typeof t != "object") return t;
|
|
230
236
|
if (t instanceof Date) return new Date(t.getTime());
|
|
231
|
-
if (Array.isArray(t)) return t.map((n) =>
|
|
237
|
+
if (Array.isArray(t)) return t.map((n) => T(n));
|
|
232
238
|
const e = {};
|
|
233
239
|
return Object.keys(t).forEach((n) => {
|
|
234
|
-
e[n] =
|
|
240
|
+
e[n] = T(t[n]);
|
|
235
241
|
}), e;
|
|
236
242
|
}
|
|
237
243
|
function tt(t, e = 300) {
|
|
@@ -249,7 +255,7 @@ function et(t, e = 300) {
|
|
|
249
255
|
s - n >= e && (n = s, t.apply(this, i));
|
|
250
256
|
};
|
|
251
257
|
}
|
|
252
|
-
function
|
|
258
|
+
function x(t) {
|
|
253
259
|
if (t == null || t === "") return null;
|
|
254
260
|
if (t instanceof Date)
|
|
255
261
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
@@ -271,13 +277,13 @@ function C(t) {
|
|
|
271
277
|
/^(\d{4})[-/.年](\d{1,2})[-/.月](\d{1,2})日?(?:[\sT]+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\.(\d{1,3}))?)?/
|
|
272
278
|
);
|
|
273
279
|
if (n) {
|
|
274
|
-
const [, i, s, l,
|
|
280
|
+
const [, i, s, l, a = "0", f = "0", c = "0", o = "0"] = n, u = new Date(
|
|
275
281
|
Number(i),
|
|
276
282
|
Number(s) - 1,
|
|
277
283
|
Number(l),
|
|
278
|
-
Number(c),
|
|
279
|
-
Number(f),
|
|
280
284
|
Number(a),
|
|
285
|
+
Number(f),
|
|
286
|
+
Number(c),
|
|
281
287
|
Number(String(o).padEnd(3, "0"))
|
|
282
288
|
);
|
|
283
289
|
return Number.isNaN(u.getTime()) ? null : u;
|
|
@@ -285,31 +291,31 @@ function C(t) {
|
|
|
285
291
|
const r = new Date(e);
|
|
286
292
|
return Number.isNaN(r.getTime()) ? null : r;
|
|
287
293
|
}
|
|
288
|
-
function
|
|
289
|
-
const n =
|
|
294
|
+
function w(t, e = "YYYY-MM-DD HH:mm:ss") {
|
|
295
|
+
const n = x(t);
|
|
290
296
|
if (!n) return "";
|
|
291
|
-
const r = n.getFullYear(), i = n.getMonth() + 1, s = n.getDate(), l = n.getHours(),
|
|
297
|
+
const r = n.getFullYear(), i = n.getMonth() + 1, s = n.getDate(), l = n.getHours(), a = n.getMinutes(), f = n.getSeconds(), c = {
|
|
292
298
|
YYYY: String(r),
|
|
293
299
|
MM: String(i).padStart(2, "0"),
|
|
294
300
|
DD: String(s).padStart(2, "0"),
|
|
295
301
|
HH: String(l).padStart(2, "0"),
|
|
296
|
-
mm: String(
|
|
302
|
+
mm: String(a).padStart(2, "0"),
|
|
297
303
|
ss: String(f).padStart(2, "0"),
|
|
298
304
|
M: String(i),
|
|
299
305
|
D: String(s),
|
|
300
306
|
H: String(l),
|
|
301
|
-
m: String(
|
|
307
|
+
m: String(a),
|
|
302
308
|
s: String(f)
|
|
303
309
|
};
|
|
304
|
-
return e.replace(/YYYY|MM|DD|HH|mm|ss|M|D|H|m|s/g, (o) =>
|
|
310
|
+
return e.replace(/YYYY|MM|DD|HH|mm|ss|M|D|H|m|s/g, (o) => c[o]);
|
|
305
311
|
}
|
|
306
312
|
function nt() {
|
|
307
313
|
const t = /* @__PURE__ */ new Date();
|
|
308
314
|
t.setHours(23, 59, 59, 0);
|
|
309
315
|
const e = /* @__PURE__ */ new Date();
|
|
310
316
|
return e.setDate(e.getDate() - 30), e.setHours(0, 0, 0, 0), {
|
|
311
|
-
start:
|
|
312
|
-
end:
|
|
317
|
+
start: w(e, "YYYY-MM-DD HH:mm:ss"),
|
|
318
|
+
end: w(t, "YYYY-MM-DD HH:mm:ss")
|
|
313
319
|
};
|
|
314
320
|
}
|
|
315
321
|
function h(t) {
|
|
@@ -319,37 +325,43 @@ function h(t) {
|
|
|
319
325
|
r == null || r === "" || Array.isArray(r) && r.length === 0 || (e[n] = r);
|
|
320
326
|
}), e;
|
|
321
327
|
}
|
|
322
|
-
function
|
|
323
|
-
|
|
328
|
+
function rt(t) {
|
|
329
|
+
return t == null || t === "" ? "-" : t;
|
|
330
|
+
}
|
|
331
|
+
function E(t, e = 2) {
|
|
332
|
+
if (t == null || t === "") return "-";
|
|
324
333
|
const n = Number(t);
|
|
325
334
|
if (Number.isNaN(n)) return t;
|
|
326
335
|
const r = n.toFixed(e), [i, s] = r.split("."), l = i.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
327
336
|
if (s == null) return l;
|
|
328
|
-
const
|
|
329
|
-
return
|
|
337
|
+
const a = s.replace(/0+$/, "");
|
|
338
|
+
return a ? `${l}.${a}` : l;
|
|
330
339
|
}
|
|
331
|
-
function
|
|
340
|
+
function it(t) {
|
|
332
341
|
if (t == null || t === "") return "-";
|
|
333
342
|
const e = Number(t);
|
|
334
|
-
return Number.isNaN(e) ? "-" : Math.abs(e) > 1e4 ? `${
|
|
343
|
+
return Number.isNaN(e) ? "-" : Math.abs(e) > 1e4 ? `${E(e / 1e4, 2)}w` : String(E(e, 0));
|
|
344
|
+
}
|
|
345
|
+
function st(t, e = 4, n = "toDecimal") {
|
|
346
|
+
if (n === "toPercent" || n === "toPercentText") {
|
|
347
|
+
if (t == null || t === "") return n === "toPercentText" ? "-" : t;
|
|
348
|
+
const i = Number(t);
|
|
349
|
+
if (!Number.isFinite(i) || Number.isNaN(i)) return n === "toPercentText" ? "-" : t;
|
|
350
|
+
if (i === 0) return n === "toPercentText" ? "0%" : 0;
|
|
351
|
+
const s = Number(String(Number((i * 100).toFixed(2))).replace(/(?:\.0*|(\.\d+?)0+)$/, "$1"));
|
|
352
|
+
return n === "toPercentText" ? `${s}%` : s;
|
|
353
|
+
}
|
|
354
|
+
if (t === "" || t == null) return;
|
|
355
|
+
const r = Number(t);
|
|
356
|
+
if (Number.isFinite(r))
|
|
357
|
+
return Number((r / 100).toFixed(e));
|
|
335
358
|
}
|
|
336
|
-
function
|
|
337
|
-
if (t
|
|
359
|
+
function ot(t) {
|
|
360
|
+
if (t === "" || t == null) return "";
|
|
338
361
|
const e = Number(t);
|
|
339
|
-
return
|
|
362
|
+
return Number.isFinite(e) ? e : "";
|
|
340
363
|
}
|
|
341
|
-
function
|
|
342
|
-
if (t == null || t === "") return "-";
|
|
343
|
-
const e = R(t);
|
|
344
|
-
return e == null || e === "" || Number.isNaN(Number(e)) ? "-" : `${e}%`;
|
|
345
|
-
}
|
|
346
|
-
function st(t, e = 4) {
|
|
347
|
-
if (t === "" || t == null) return;
|
|
348
|
-
const n = Number(t);
|
|
349
|
-
if (Number.isFinite(n))
|
|
350
|
-
return Number((n / 100).toFixed(e));
|
|
351
|
-
}
|
|
352
|
-
function ot(t, e = 2, n = 9999999999999) {
|
|
364
|
+
function ut(t, e = 2, n = 9999999999999) {
|
|
353
365
|
if (t === 0 || t === "0") return 0;
|
|
354
366
|
if (t == null || t === "") return "";
|
|
355
367
|
let r = Number(t);
|
|
@@ -357,40 +369,40 @@ function ot(t, e = 2, n = 9999999999999) {
|
|
|
357
369
|
const i = Number(n), s = Number.isFinite(i) ? Math.abs(i) : 9999999999999;
|
|
358
370
|
return Math.abs(r) >= s && (r = r < 0 ? -s : s), Number.isInteger(r) ? r : Number(r.toFixed(e));
|
|
359
371
|
}
|
|
360
|
-
function
|
|
372
|
+
function ct(t = "id") {
|
|
361
373
|
return `${t}_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
362
374
|
}
|
|
363
|
-
const
|
|
375
|
+
const pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
364
376
|
__proto__: null,
|
|
365
|
-
cleanNumber:
|
|
377
|
+
cleanNumber: ut,
|
|
366
378
|
cleanParams: h,
|
|
367
379
|
clearPlatformCache: Q,
|
|
368
380
|
debounce: tt,
|
|
369
|
-
deepClone:
|
|
381
|
+
deepClone: T,
|
|
370
382
|
downloadBlob: $,
|
|
371
383
|
exportFile: z,
|
|
372
384
|
findPlatformLogo: X,
|
|
373
|
-
formatDate:
|
|
374
|
-
|
|
375
|
-
|
|
385
|
+
formatDate: w,
|
|
386
|
+
formatEmpty: rt,
|
|
387
|
+
formatFansCount: it,
|
|
388
|
+
formatNum: E,
|
|
376
389
|
getRecentMonthRange: nt,
|
|
377
|
-
isEmail:
|
|
390
|
+
isEmail: C,
|
|
378
391
|
isEmpty: v,
|
|
379
392
|
isMainlandIdCard: I,
|
|
380
393
|
isMobile: O,
|
|
381
|
-
|
|
382
|
-
numberRatioText: it,
|
|
383
|
-
parseDate: C,
|
|
394
|
+
parseDate: x,
|
|
384
395
|
preloadPlatformList: J,
|
|
385
396
|
setPlatformCache: Y,
|
|
386
397
|
throttle: et,
|
|
398
|
+
toNumberOrEmpty: ot,
|
|
387
399
|
toRebateRatio: st,
|
|
388
|
-
uniqueId:
|
|
400
|
+
uniqueId: ct,
|
|
389
401
|
validateEmail: W,
|
|
390
402
|
validateIdCardNo: Z,
|
|
391
403
|
validateMobile: V
|
|
392
404
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
393
|
-
function
|
|
405
|
+
function yt(t) {
|
|
394
406
|
if (!t)
|
|
395
407
|
throw new Error("[mgacn-commonsdk] createApi 需要传入 request 实例");
|
|
396
408
|
return {
|
|
@@ -434,7 +446,7 @@ function pt(t) {
|
|
|
434
446
|
"/yhAdmin/user/queryUserByRoleName",
|
|
435
447
|
h({
|
|
436
448
|
...r,
|
|
437
|
-
systemId:
|
|
449
|
+
systemId: S()
|
|
438
450
|
})
|
|
439
451
|
);
|
|
440
452
|
return Array.isArray(i) ? i : Array.isArray(i == null ? void 0 : i.result) ? i.result : Array.isArray(i == null ? void 0 : i.list) ? i.list : [];
|
|
@@ -480,7 +492,7 @@ function pt(t) {
|
|
|
480
492
|
h({
|
|
481
493
|
...s,
|
|
482
494
|
userId: H(),
|
|
483
|
-
projectId:
|
|
495
|
+
projectId: S(),
|
|
484
496
|
clientType: 1
|
|
485
497
|
})
|
|
486
498
|
);
|
|
@@ -491,12 +503,12 @@ function pt(t) {
|
|
|
491
503
|
}
|
|
492
504
|
};
|
|
493
505
|
}
|
|
494
|
-
const
|
|
495
|
-
function
|
|
496
|
-
globalThis[
|
|
506
|
+
const R = "__MGACN_COMMONSDK_API__";
|
|
507
|
+
function bt(t) {
|
|
508
|
+
globalThis[R] = t;
|
|
497
509
|
}
|
|
498
510
|
function at() {
|
|
499
|
-
const t = globalThis[
|
|
511
|
+
const t = globalThis[R];
|
|
500
512
|
if (!t)
|
|
501
513
|
throw new Error("[mgacn-commonsdk] 请先 app.use(MgacnCommonSdk, { tokenKey, baseURL })");
|
|
502
514
|
return t;
|
|
@@ -505,45 +517,47 @@ const j = "__MGACN_COMMONSDK_PERMISSION_GETTER__";
|
|
|
505
517
|
function ht(t) {
|
|
506
518
|
globalThis[j] = typeof t == "function" ? t : null;
|
|
507
519
|
}
|
|
508
|
-
function
|
|
520
|
+
function lt() {
|
|
509
521
|
return globalThis[j] || null;
|
|
510
522
|
}
|
|
511
|
-
function
|
|
523
|
+
function ft(t, e, n = "and") {
|
|
512
524
|
const r = (Array.isArray(e) ? e : [e]).map((s) => String(s ?? "").trim()).filter(Boolean);
|
|
513
525
|
if (!r.length) return !0;
|
|
514
526
|
const i = new Set((t || []).map(String));
|
|
515
527
|
return n === "or" ? r.some((s) => i.has(s)) : r.every((s) => i.has(s));
|
|
516
528
|
}
|
|
517
|
-
function
|
|
518
|
-
const n =
|
|
519
|
-
return typeof n != "function" ? !0 :
|
|
529
|
+
function Nt(t, e = "and") {
|
|
530
|
+
const n = lt();
|
|
531
|
+
return typeof n != "function" ? !0 : ft(n(), t, e);
|
|
520
532
|
}
|
|
521
|
-
const
|
|
533
|
+
const St = (t, e) => {
|
|
522
534
|
const n = t.__vccOpts || t;
|
|
523
535
|
for (const [r, i] of e)
|
|
524
536
|
n[r] = i;
|
|
525
537
|
return n;
|
|
526
538
|
};
|
|
527
539
|
export {
|
|
528
|
-
|
|
529
|
-
|
|
540
|
+
St as _,
|
|
541
|
+
F as a,
|
|
530
542
|
L as b,
|
|
531
|
-
|
|
532
|
-
|
|
543
|
+
ft as c,
|
|
544
|
+
T as d,
|
|
533
545
|
h as e,
|
|
534
546
|
tt as f,
|
|
535
547
|
at as g,
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
548
|
+
E as h,
|
|
549
|
+
rt as i,
|
|
550
|
+
Nt as j,
|
|
551
|
+
ht as k,
|
|
552
|
+
dt as l,
|
|
553
|
+
yt as m,
|
|
554
|
+
gt as n,
|
|
555
|
+
bt as o,
|
|
556
|
+
K as p,
|
|
557
|
+
lt as q,
|
|
558
|
+
S as r,
|
|
559
|
+
G as s,
|
|
560
|
+
st as t,
|
|
561
|
+
H as u,
|
|
562
|
+
pt as v
|
|
549
563
|
};
|