mgacn-commonsdk 1.1.2 → 1.1.4
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-CMKnyAmb.js +532 -0
- package/dist/mgacn-admin.js +966 -950
- package/dist/mgacn-commonsdk.js +1005 -695
- package/dist/style.css +2 -2
- package/package.json +1 -1
- package/dist/_plugin-vue_export-helper-DesBodke.js +0 -473
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import U from "axios";
|
|
2
|
+
const E = "__MGACN_COMMONSDK_SYSTEM_ID__", M = "__MGACN_COMMONSDK_USER_ID__";
|
|
3
|
+
function G(t) {
|
|
4
|
+
globalThis[E] = t == null ? "" : String(t);
|
|
5
|
+
}
|
|
6
|
+
function D() {
|
|
7
|
+
return globalThis[E] || "";
|
|
8
|
+
}
|
|
9
|
+
function F(t) {
|
|
10
|
+
globalThis[M] = t == null ? "" : String(t);
|
|
11
|
+
}
|
|
12
|
+
function H() {
|
|
13
|
+
return globalThis[M] || "";
|
|
14
|
+
}
|
|
15
|
+
function K(t = {}) {
|
|
16
|
+
const {
|
|
17
|
+
baseURL: e = "",
|
|
18
|
+
timeout: n = 6e4,
|
|
19
|
+
tokenKey: r,
|
|
20
|
+
systemId: o,
|
|
21
|
+
userId: i,
|
|
22
|
+
loginUrl: l = "/login"
|
|
23
|
+
} = t;
|
|
24
|
+
o != null && o !== "" && G(o), i != null && i !== "" && F(i);
|
|
25
|
+
const c = U.create({ baseURL: e, timeout: n });
|
|
26
|
+
let f = !1;
|
|
27
|
+
function a() {
|
|
28
|
+
typeof localStorage < "u" && localStorage.clear(), !f && (f = !0, setTimeout(() => {
|
|
29
|
+
typeof window < "u" && window.location.replace(l);
|
|
30
|
+
}, 1500));
|
|
31
|
+
}
|
|
32
|
+
return c.interceptors.request.use(
|
|
33
|
+
(s) => {
|
|
34
|
+
if (s.headers["Content-Type"] = "application/json;charset=UTF-8", typeof localStorage < "u" && r) {
|
|
35
|
+
const m = localStorage.getItem(r);
|
|
36
|
+
m && (s.headers.Authorization = m);
|
|
37
|
+
}
|
|
38
|
+
const u = D();
|
|
39
|
+
return u && (s.headers.systemId = u), s;
|
|
40
|
+
},
|
|
41
|
+
(s) => Promise.reject(s)
|
|
42
|
+
), c.interceptors.response.use(
|
|
43
|
+
(s) => {
|
|
44
|
+
if (s.status !== 200)
|
|
45
|
+
return Promise.reject(new Error(`请求发生错误,状态码 ${s.status}`));
|
|
46
|
+
const { data: u, config: m } = s;
|
|
47
|
+
if (m.responseType === "arraybuffer" || m.responseType === "blob")
|
|
48
|
+
return u;
|
|
49
|
+
if (u && u.code === 0) return u.data;
|
|
50
|
+
const p = Number(u == null ? void 0 : u.code);
|
|
51
|
+
if (p === 401 || p === 403)
|
|
52
|
+
return a(), Promise.reject(new Error("登录失效,请重新登录"));
|
|
53
|
+
const b = _(u) || "请求失败", d = new Error(b);
|
|
54
|
+
return d.code = p, d.data = u == null ? void 0 : u.data, d.biz = u, Promise.reject(d);
|
|
55
|
+
},
|
|
56
|
+
(s) => {
|
|
57
|
+
var b, d;
|
|
58
|
+
const u = (b = s == null ? void 0 : s.response) == null ? void 0 : b.status;
|
|
59
|
+
if (u === 401 || u === 403)
|
|
60
|
+
return a(), Promise.reject(new Error("登录失效,请重新登录"));
|
|
61
|
+
const m = (d = s == null ? void 0 : s.response) == null ? void 0 : d.data, p = _(m) || (s == null ? void 0 : s.message) || "请求失败";
|
|
62
|
+
return Promise.reject(new Error(String(p)));
|
|
63
|
+
}
|
|
64
|
+
), c;
|
|
65
|
+
}
|
|
66
|
+
function _(t) {
|
|
67
|
+
if (t == null) return "";
|
|
68
|
+
if (typeof t == "string") {
|
|
69
|
+
const n = t.trim();
|
|
70
|
+
return n ? /^<!DOCTYPE html>/i.test(n) || /^<html[\s>]/i.test(n) ? "接口地址无效或未配置代理" : n.length > 200 ? `${n.slice(0, 200)}…` : n : "";
|
|
71
|
+
}
|
|
72
|
+
if (typeof t != "object") return String(t);
|
|
73
|
+
const e = [t.message, t.msg, t.data, t.error];
|
|
74
|
+
for (const n of e)
|
|
75
|
+
if (!(n == null || n === "") && (typeof n == "string" || typeof n == "number")) {
|
|
76
|
+
const r = String(n).trim();
|
|
77
|
+
return /^<!DOCTYPE html>/i.test(r) || /^<html[\s>]/i.test(r) ? "接口地址无效或未配置代理" : r.length > 200 ? `${r.slice(0, 200)}…` : r;
|
|
78
|
+
}
|
|
79
|
+
return "";
|
|
80
|
+
}
|
|
81
|
+
function mt(t = {}) {
|
|
82
|
+
const e = K(t);
|
|
83
|
+
return {
|
|
84
|
+
GET(n, r = {}) {
|
|
85
|
+
return e({ method: "get", url: n, ...r });
|
|
86
|
+
},
|
|
87
|
+
POST(n, r, o = {}) {
|
|
88
|
+
return e({ method: "post", url: n, data: r, ...o });
|
|
89
|
+
},
|
|
90
|
+
DELETE(n, r = {}) {
|
|
91
|
+
return e({ method: "delete", url: n, ...r });
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const A = "__MGACN_COMMONSDK_REQUEST__";
|
|
96
|
+
function dt(t) {
|
|
97
|
+
globalThis[A] = t;
|
|
98
|
+
}
|
|
99
|
+
function L() {
|
|
100
|
+
const t = globalThis[A];
|
|
101
|
+
if (!t)
|
|
102
|
+
throw new Error("[mgacn-commonsdk] 请先 app.use(MgacnCommonSdk, { tokenKey, baseURL })");
|
|
103
|
+
return t;
|
|
104
|
+
}
|
|
105
|
+
function $(t, e, n = "application/vnd.ms-excel") {
|
|
106
|
+
if (t == null || typeof window > "u") return;
|
|
107
|
+
const r = t instanceof Blob ? t : new Blob([t], { type: n }), o = window.URL.createObjectURL(r), i = document.createElement("a");
|
|
108
|
+
i.href = o, i.download = e || "download", i.style.display = "none", document.body.appendChild(i), i.click(), document.body.removeChild(i), window.URL.revokeObjectURL(o);
|
|
109
|
+
}
|
|
110
|
+
function h(t) {
|
|
111
|
+
return String(t).padStart(2, "0");
|
|
112
|
+
}
|
|
113
|
+
function B(t = /* @__PURE__ */ new Date()) {
|
|
114
|
+
return `${t.getFullYear()}${h(t.getMonth() + 1)}${h(t.getDate())}${h(t.getHours())}${h(t.getMinutes())}${h(t.getSeconds())}`;
|
|
115
|
+
}
|
|
116
|
+
async function z(t) {
|
|
117
|
+
if (!(t instanceof Blob) || !t.type || !/json/i.test(t.type)) return;
|
|
118
|
+
const e = await t.text();
|
|
119
|
+
let n = "导出失败";
|
|
120
|
+
try {
|
|
121
|
+
const r = JSON.parse(e);
|
|
122
|
+
n = (r == null ? void 0 : r.message) || (r == null ? void 0 : r.msg) || n;
|
|
123
|
+
} catch {
|
|
124
|
+
}
|
|
125
|
+
throw new Error(n);
|
|
126
|
+
}
|
|
127
|
+
async function k(t = {}) {
|
|
128
|
+
const {
|
|
129
|
+
url: e,
|
|
130
|
+
data: n,
|
|
131
|
+
params: r,
|
|
132
|
+
method: o = "POST",
|
|
133
|
+
filename: i,
|
|
134
|
+
ext: l = "xlsx"
|
|
135
|
+
} = t;
|
|
136
|
+
if (!e) throw new Error("导出地址不能为空");
|
|
137
|
+
if (!i) throw new Error("导出文件名不能为空");
|
|
138
|
+
const c = L(), f = String(o).toUpperCase();
|
|
139
|
+
let a;
|
|
140
|
+
f === "GET" ? a = await c.GET(e, { params: r, responseType: "blob" }) : a = await c.POST(e, n, { responseType: "blob" }), await z(a);
|
|
141
|
+
const u = /\.[a-z0-9]+$/i.test(i) ? i : `${i}_${B()}.${l}`;
|
|
142
|
+
return $(a, u), u;
|
|
143
|
+
}
|
|
144
|
+
let g = null;
|
|
145
|
+
function q(t, e) {
|
|
146
|
+
if (!t || e == null || e === "") return !1;
|
|
147
|
+
if (typeof e == "object")
|
|
148
|
+
return e.id != null && e.id !== "" && String(t.id) === String(e.id) || e.platformName != null && e.platformName !== "" && String(t.platformName || "") === String(e.platformName).trim();
|
|
149
|
+
const n = String(e).trim();
|
|
150
|
+
return t.id != null && String(t.id) === n || String(t.platformName || "") === n;
|
|
151
|
+
}
|
|
152
|
+
function Y(t) {
|
|
153
|
+
g = Array.isArray(t) ? t : [];
|
|
154
|
+
}
|
|
155
|
+
function Q() {
|
|
156
|
+
g = null;
|
|
157
|
+
}
|
|
158
|
+
function X(t) {
|
|
159
|
+
if (!Array.isArray(g) || !g.length) return "";
|
|
160
|
+
const e = g.find((n) => q(n, t));
|
|
161
|
+
return (e == null ? void 0 : e.platformLogo) || "";
|
|
162
|
+
}
|
|
163
|
+
async function J() {
|
|
164
|
+
const t = await at().listPlatformInfoAll();
|
|
165
|
+
return Y(t), g;
|
|
166
|
+
}
|
|
167
|
+
function C(t) {
|
|
168
|
+
const e = String(t || "").trim().toUpperCase();
|
|
169
|
+
if (/^\d{15}$/.test(e)) {
|
|
170
|
+
const a = +`19${e.slice(6, 8)}`, s = Number(e.slice(8, 10)), u = Number(e.slice(10, 12)), m = new Date(a, s - 1, u);
|
|
171
|
+
return m.getFullYear() === a && m.getMonth() + 1 === s && m.getDate() === u;
|
|
172
|
+
}
|
|
173
|
+
if (!/^\d{17}[\dX]$/.test(e)) return !1;
|
|
174
|
+
const n = Number(e.slice(6, 10)), r = Number(e.slice(10, 12)), o = Number(e.slice(12, 14)), i = new Date(n, r - 1, o);
|
|
175
|
+
if (i.getFullYear() !== n || i.getMonth() + 1 !== r || i.getDate() !== o) return !1;
|
|
176
|
+
const l = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2], c = "10X98765432";
|
|
177
|
+
let f = 0;
|
|
178
|
+
for (let a = 0; a < 17; a++) f += Number(e[a]) * l[a];
|
|
179
|
+
return c[f % 11] === e[17];
|
|
180
|
+
}
|
|
181
|
+
function O(t) {
|
|
182
|
+
const e = String(t || "").trim().replace(/\s+/g, "");
|
|
183
|
+
return e ? /^1\d{10}$/.test(e) || /^\+[1-9]\d{6,14}$/.test(e) : !1;
|
|
184
|
+
}
|
|
185
|
+
function P(t) {
|
|
186
|
+
const e = String(t || "").trim();
|
|
187
|
+
return e ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) : !1;
|
|
188
|
+
}
|
|
189
|
+
function w(t) {
|
|
190
|
+
return t == null || t === "";
|
|
191
|
+
}
|
|
192
|
+
function Z(t, e, n) {
|
|
193
|
+
if (w(e)) {
|
|
194
|
+
n();
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (!C(e)) {
|
|
198
|
+
n(new Error("请输入正确的身份证号(15/18位)"));
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
n();
|
|
202
|
+
}
|
|
203
|
+
function V(t, e, n) {
|
|
204
|
+
if (w(e)) {
|
|
205
|
+
n();
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (!O(e)) {
|
|
209
|
+
n(new Error("请输入正确的国内或海外手机号"));
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
n();
|
|
213
|
+
}
|
|
214
|
+
function W(t, e, n) {
|
|
215
|
+
if (w(e)) {
|
|
216
|
+
n();
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (!P(e)) {
|
|
220
|
+
n(new Error("请输入正确的邮箱"));
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
n();
|
|
224
|
+
}
|
|
225
|
+
function v(t) {
|
|
226
|
+
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
|
+
}
|
|
228
|
+
function N(t) {
|
|
229
|
+
if (t === null || typeof t != "object") return t;
|
|
230
|
+
if (t instanceof Date) return new Date(t.getTime());
|
|
231
|
+
if (Array.isArray(t)) return t.map((n) => N(n));
|
|
232
|
+
const e = {};
|
|
233
|
+
return Object.keys(t).forEach((n) => {
|
|
234
|
+
e[n] = N(t[n]);
|
|
235
|
+
}), e;
|
|
236
|
+
}
|
|
237
|
+
function tt(t, e = 300) {
|
|
238
|
+
let n = null;
|
|
239
|
+
return function(...o) {
|
|
240
|
+
n && clearTimeout(n), n = setTimeout(() => {
|
|
241
|
+
t.apply(this, o);
|
|
242
|
+
}, e);
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function et(t, e = 300) {
|
|
246
|
+
let n = 0;
|
|
247
|
+
return function(...o) {
|
|
248
|
+
const i = Date.now();
|
|
249
|
+
i - n >= e && (n = i, t.apply(this, o));
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function I(t) {
|
|
253
|
+
if (t == null || t === "") return null;
|
|
254
|
+
if (t instanceof Date)
|
|
255
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
256
|
+
if (typeof t == "number") {
|
|
257
|
+
const o = new Date(t);
|
|
258
|
+
return Number.isNaN(o.getTime()) ? null : o;
|
|
259
|
+
}
|
|
260
|
+
const e = String(t).trim();
|
|
261
|
+
if (!e) return null;
|
|
262
|
+
if (/^\d{10,13}$/.test(e)) {
|
|
263
|
+
const o = e.length === 10 ? Number(e) * 1e3 : Number(e), i = new Date(o);
|
|
264
|
+
return Number.isNaN(i.getTime()) ? null : i;
|
|
265
|
+
}
|
|
266
|
+
if (/[Zz]$|[+-]\d{2}:?\d{2}$/.test(e)) {
|
|
267
|
+
const o = new Date(e);
|
|
268
|
+
return Number.isNaN(o.getTime()) ? null : o;
|
|
269
|
+
}
|
|
270
|
+
const n = e.match(
|
|
271
|
+
/^(\d{4})[-/.年](\d{1,2})[-/.月](\d{1,2})日?(?:[\sT]+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\.(\d{1,3}))?)?/
|
|
272
|
+
);
|
|
273
|
+
if (n) {
|
|
274
|
+
const [, o, i, l, c = "0", f = "0", a = "0", s = "0"] = n, u = new Date(
|
|
275
|
+
Number(o),
|
|
276
|
+
Number(i) - 1,
|
|
277
|
+
Number(l),
|
|
278
|
+
Number(c),
|
|
279
|
+
Number(f),
|
|
280
|
+
Number(a),
|
|
281
|
+
Number(String(s).padEnd(3, "0"))
|
|
282
|
+
);
|
|
283
|
+
return Number.isNaN(u.getTime()) ? null : u;
|
|
284
|
+
}
|
|
285
|
+
const r = new Date(e);
|
|
286
|
+
return Number.isNaN(r.getTime()) ? null : r;
|
|
287
|
+
}
|
|
288
|
+
function y(t, e = "YYYY-MM-DD HH:mm:ss") {
|
|
289
|
+
const n = I(t);
|
|
290
|
+
if (!n) return "";
|
|
291
|
+
const r = n.getFullYear(), o = n.getMonth() + 1, i = n.getDate(), l = n.getHours(), c = n.getMinutes(), f = n.getSeconds(), a = {
|
|
292
|
+
YYYY: String(r),
|
|
293
|
+
MM: String(o).padStart(2, "0"),
|
|
294
|
+
DD: String(i).padStart(2, "0"),
|
|
295
|
+
HH: String(l).padStart(2, "0"),
|
|
296
|
+
mm: String(c).padStart(2, "0"),
|
|
297
|
+
ss: String(f).padStart(2, "0"),
|
|
298
|
+
M: String(o),
|
|
299
|
+
D: String(i),
|
|
300
|
+
H: String(l),
|
|
301
|
+
m: String(c),
|
|
302
|
+
s: String(f)
|
|
303
|
+
};
|
|
304
|
+
return e.replace(/YYYY|MM|DD|HH|mm|ss|M|D|H|m|s/g, (s) => a[s]);
|
|
305
|
+
}
|
|
306
|
+
function nt() {
|
|
307
|
+
const t = /* @__PURE__ */ new Date();
|
|
308
|
+
t.setHours(23, 59, 59, 0);
|
|
309
|
+
const e = /* @__PURE__ */ new Date();
|
|
310
|
+
return e.setDate(e.getDate() - 30), e.setHours(0, 0, 0, 0), {
|
|
311
|
+
start: y(e, "YYYY-MM-DD HH:mm:ss"),
|
|
312
|
+
end: y(t, "YYYY-MM-DD HH:mm:ss")
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
function S(t) {
|
|
316
|
+
const e = {};
|
|
317
|
+
return Object.keys(t || {}).forEach((n) => {
|
|
318
|
+
const r = t[n];
|
|
319
|
+
r == null || r === "" || Array.isArray(r) && r.length === 0 || (e[n] = r);
|
|
320
|
+
}), e;
|
|
321
|
+
}
|
|
322
|
+
function T(t, e = 2) {
|
|
323
|
+
if (t == null || t === "") return t;
|
|
324
|
+
const n = Number(t);
|
|
325
|
+
if (Number.isNaN(n)) return t;
|
|
326
|
+
const r = n.toFixed(e), [o, i] = r.split("."), l = o.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
327
|
+
if (i == null) return l;
|
|
328
|
+
const c = i.replace(/0+$/, "");
|
|
329
|
+
return c ? `${l}.${c}` : l;
|
|
330
|
+
}
|
|
331
|
+
function rt(t) {
|
|
332
|
+
if (t == null || t === "") return "-";
|
|
333
|
+
const e = Number(t);
|
|
334
|
+
return Number.isNaN(e) ? "-" : Math.abs(e) > 1e4 ? `${T(e / 1e4, 2)}w` : String(T(e, 0));
|
|
335
|
+
}
|
|
336
|
+
function x(t) {
|
|
337
|
+
if (t == null || t === "") return t;
|
|
338
|
+
const e = Number(t);
|
|
339
|
+
return !Number.isFinite(e) || Number.isNaN(e) ? t : e === 0 ? 0 : Number(String((e * 100).toFixed(2)).replace(/(?:\.0*|(\.\d+?)0+)$/, "$1"));
|
|
340
|
+
}
|
|
341
|
+
function it(t) {
|
|
342
|
+
if (t == null || t === "") return "-";
|
|
343
|
+
const e = x(t);
|
|
344
|
+
return e == null || e === "" || Number.isNaN(Number(e)) ? "-" : `${e}%`;
|
|
345
|
+
}
|
|
346
|
+
function ot(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 st(t, e = 2, n = 1e9) {
|
|
353
|
+
if (t === 0 || t === "0") return 0;
|
|
354
|
+
if (t == null || t === "") return "";
|
|
355
|
+
let r = Number(t);
|
|
356
|
+
if (!Number.isFinite(r)) return "";
|
|
357
|
+
const o = Number(n), i = Number.isFinite(o) ? Math.abs(o) : 1e9;
|
|
358
|
+
return Math.abs(r) >= i && (r = r < 0 ? -i : i), Number.isInteger(r) ? r : Number(r.toFixed(e));
|
|
359
|
+
}
|
|
360
|
+
function ut(t = "id") {
|
|
361
|
+
return `${t}_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
362
|
+
}
|
|
363
|
+
const gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
364
|
+
__proto__: null,
|
|
365
|
+
cleanNumber: st,
|
|
366
|
+
cleanParams: S,
|
|
367
|
+
clearPlatformCache: Q,
|
|
368
|
+
debounce: tt,
|
|
369
|
+
deepClone: N,
|
|
370
|
+
downloadBlob: $,
|
|
371
|
+
exportFile: k,
|
|
372
|
+
findPlatformLogo: X,
|
|
373
|
+
formatDate: y,
|
|
374
|
+
formatFansCount: rt,
|
|
375
|
+
formatNum: T,
|
|
376
|
+
getRecentMonthRange: nt,
|
|
377
|
+
isEmail: P,
|
|
378
|
+
isEmpty: v,
|
|
379
|
+
isMainlandIdCard: C,
|
|
380
|
+
isMobile: O,
|
|
381
|
+
numberRatio: x,
|
|
382
|
+
numberRatioText: it,
|
|
383
|
+
parseDate: I,
|
|
384
|
+
preloadPlatformList: J,
|
|
385
|
+
setPlatformCache: Y,
|
|
386
|
+
throttle: et,
|
|
387
|
+
toRebateRatio: ot,
|
|
388
|
+
uniqueId: ut,
|
|
389
|
+
validateEmail: W,
|
|
390
|
+
validateIdCardNo: Z,
|
|
391
|
+
validateMobile: V
|
|
392
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
393
|
+
function pt(t) {
|
|
394
|
+
if (!t)
|
|
395
|
+
throw new Error("[mgacn-commonsdk] createApi 需要传入 request 实例");
|
|
396
|
+
return {
|
|
397
|
+
// ---------- 注销登录 ----------
|
|
398
|
+
logout(e) {
|
|
399
|
+
return t.GET(`/yhAdmin/login/exit/${e}`);
|
|
400
|
+
},
|
|
401
|
+
// ---------- 用户 ----------
|
|
402
|
+
getUserInfo(e) {
|
|
403
|
+
return t.GET(`/yhAdmin/user/queryUser/${e}`);
|
|
404
|
+
},
|
|
405
|
+
/**
|
|
406
|
+
* 用户下拉选择列表
|
|
407
|
+
* POST /yhAdmin/user/listForSelect
|
|
408
|
+
* @param {object} [params]
|
|
409
|
+
* @param {0|1} [params.status] 0 正常/有效,1 禁用/锁定;不传查全部
|
|
410
|
+
* @param {0|1} [params.isDelete] 0 否,1 是;不传默认查未删除
|
|
411
|
+
* @param {string} [params.realName] 真实姓名,模糊
|
|
412
|
+
* @param {string} [params.username] 登录账号/工号,模糊
|
|
413
|
+
* @param {string} [params.mobile] 手机号,模糊
|
|
414
|
+
* @param {string} [params.openId] 第三方 openId,模糊
|
|
415
|
+
* @param {string} [params.createTimeStart]
|
|
416
|
+
* @param {string} [params.createTimeEnd]
|
|
417
|
+
* @param {string} [params.updateTimeStart]
|
|
418
|
+
* @param {string} [params.updateTimeEnd]
|
|
419
|
+
* @returns {Promise<Array>} 用户列表(兼容 result / list / 直接数组)
|
|
420
|
+
*/
|
|
421
|
+
async listUserForSelect(e = {}) {
|
|
422
|
+
const n = await t.POST("/yhAdmin/user/listForSelect", S(e));
|
|
423
|
+
return Array.isArray(n) ? n : Array.isArray(n == null ? void 0 : n.result) ? n.result : Array.isArray(n == null ? void 0 : n.list) ? n.list : [];
|
|
424
|
+
},
|
|
425
|
+
/**
|
|
426
|
+
* 媒介供应商全量列表(下拉)
|
|
427
|
+
* GET /yhAccount/mediaSupplier/listAll
|
|
428
|
+
*/
|
|
429
|
+
listMediaSupplierAll() {
|
|
430
|
+
return t.GET("/yhAccount/mediaSupplier/listAll");
|
|
431
|
+
},
|
|
432
|
+
/**
|
|
433
|
+
* 账号库平台配置全量列表(下拉)
|
|
434
|
+
* GET /yhAccount/platformInfo/listAll
|
|
435
|
+
*/
|
|
436
|
+
listPlatformInfoAll() {
|
|
437
|
+
return t.GET("/yhAccount/platformInfo/listAll");
|
|
438
|
+
},
|
|
439
|
+
/**
|
|
440
|
+
* 标签配置全量列表
|
|
441
|
+
* GET /yhShared/tagConfig/queryAllTagConfigs
|
|
442
|
+
* @param {object} [params]
|
|
443
|
+
* @param {string} [params.businessKey]
|
|
444
|
+
*/
|
|
445
|
+
queryAllTagConfigs(e = {}) {
|
|
446
|
+
return t.GET("/yhShared/tagConfig/queryAllTagConfigs", {
|
|
447
|
+
params: S(e)
|
|
448
|
+
});
|
|
449
|
+
},
|
|
450
|
+
/**
|
|
451
|
+
* 写入埋点数据
|
|
452
|
+
* POST /yhAdmin/trace/addTraceData
|
|
453
|
+
* userId / projectId(系统 id) / clientType 由组件库自动填充,宿主勿传
|
|
454
|
+
* @param {object} params 宿主业务参数
|
|
455
|
+
* @param {string} params.traceId 事件 ID
|
|
456
|
+
* @param {string} [params.route] 页面路由
|
|
457
|
+
* @param {string} [params.wxUserId] 微信用户 ID
|
|
458
|
+
*/
|
|
459
|
+
addTraceData(e = {}) {
|
|
460
|
+
const { userId: n, projectId: r, clientType: o, ...i } = e && typeof e == "object" ? e : {};
|
|
461
|
+
return t.POST(
|
|
462
|
+
"/yhAdmin/trace/addTraceData",
|
|
463
|
+
S({
|
|
464
|
+
...i,
|
|
465
|
+
userId: H(),
|
|
466
|
+
projectId: D(),
|
|
467
|
+
clientType: 1
|
|
468
|
+
})
|
|
469
|
+
);
|
|
470
|
+
},
|
|
471
|
+
// ---------- OSS ----------
|
|
472
|
+
getOssSts(e) {
|
|
473
|
+
return t.GET("/yhAdmin/oss/getStsToken", { params: { dir: e } });
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
const R = "__MGACN_COMMONSDK_API__";
|
|
478
|
+
function ht(t) {
|
|
479
|
+
globalThis[R] = t;
|
|
480
|
+
}
|
|
481
|
+
function at() {
|
|
482
|
+
const t = globalThis[R];
|
|
483
|
+
if (!t)
|
|
484
|
+
throw new Error("[mgacn-commonsdk] 请先 app.use(MgacnCommonSdk, { tokenKey, baseURL })");
|
|
485
|
+
return t;
|
|
486
|
+
}
|
|
487
|
+
const j = "__MGACN_COMMONSDK_PERMISSION_GETTER__";
|
|
488
|
+
function bt(t) {
|
|
489
|
+
globalThis[j] = typeof t == "function" ? t : null;
|
|
490
|
+
}
|
|
491
|
+
function ct() {
|
|
492
|
+
return globalThis[j] || null;
|
|
493
|
+
}
|
|
494
|
+
function lt(t, e, n = "and") {
|
|
495
|
+
const r = (Array.isArray(e) ? e : [e]).map((i) => String(i ?? "").trim()).filter(Boolean);
|
|
496
|
+
if (!r.length) return !0;
|
|
497
|
+
const o = new Set((t || []).map(String));
|
|
498
|
+
return n === "or" ? r.some((i) => o.has(i)) : r.every((i) => o.has(i));
|
|
499
|
+
}
|
|
500
|
+
function St(t, e = "and") {
|
|
501
|
+
const n = ct();
|
|
502
|
+
return typeof n != "function" ? !0 : lt(n(), t, e);
|
|
503
|
+
}
|
|
504
|
+
const Nt = (t, e) => {
|
|
505
|
+
const n = t.__vccOpts || t;
|
|
506
|
+
for (const [r, o] of e)
|
|
507
|
+
n[r] = o;
|
|
508
|
+
return n;
|
|
509
|
+
};
|
|
510
|
+
export {
|
|
511
|
+
Nt as _,
|
|
512
|
+
G as a,
|
|
513
|
+
L as b,
|
|
514
|
+
lt as c,
|
|
515
|
+
N as d,
|
|
516
|
+
S as e,
|
|
517
|
+
tt as f,
|
|
518
|
+
at as g,
|
|
519
|
+
T as h,
|
|
520
|
+
St as i,
|
|
521
|
+
bt as j,
|
|
522
|
+
mt as k,
|
|
523
|
+
pt as l,
|
|
524
|
+
dt as m,
|
|
525
|
+
ht as n,
|
|
526
|
+
K as o,
|
|
527
|
+
ct as p,
|
|
528
|
+
D as q,
|
|
529
|
+
H as r,
|
|
530
|
+
F as s,
|
|
531
|
+
gt as t
|
|
532
|
+
};
|