mgacn-commonsdk 1.1.5 → 1.1.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.
@@ -1,10 +1,10 @@
1
1
  import U from "axios";
2
- const E = "__MGACN_COMMONSDK_SYSTEM_ID__", M = "__MGACN_COMMONSDK_USER_ID__";
2
+ const A = "__MGACN_COMMONSDK_SYSTEM_ID__", M = "__MGACN_COMMONSDK_USER_ID__";
3
3
  function G(t) {
4
- globalThis[E] = t == null ? "" : String(t);
4
+ globalThis[A] = t == null ? "" : String(t);
5
5
  }
6
- function D() {
7
- return globalThis[E] || "";
6
+ function N() {
7
+ return globalThis[A] || "";
8
8
  }
9
9
  function F(t) {
10
10
  globalThis[M] = t == null ? "" : String(t);
@@ -17,11 +17,11 @@ function K(t = {}) {
17
17
  baseURL: e = "",
18
18
  timeout: n = 6e4,
19
19
  tokenKey: r,
20
- systemId: o,
21
- userId: i,
20
+ systemId: i,
21
+ userId: s,
22
22
  loginUrl: l = "/login"
23
23
  } = t;
24
- o != null && o !== "" && G(o), i != null && i !== "" && F(i);
24
+ i != null && i !== "" && G(i), s != null && s !== "" && F(s);
25
25
  const c = U.create({ baseURL: e, timeout: n });
26
26
  let f = !1;
27
27
  function a() {
@@ -30,40 +30,40 @@ function K(t = {}) {
30
30
  }, 1500));
31
31
  }
32
32
  return c.interceptors.request.use(
33
- (s) => {
34
- if (s.headers["Content-Type"] = "application/json;charset=UTF-8", typeof localStorage < "u" && r) {
33
+ (o) => {
34
+ if (o.headers["Content-Type"] = "application/json;charset=UTF-8", typeof localStorage < "u" && r) {
35
35
  const m = localStorage.getItem(r);
36
- m && (s.headers.Authorization = m);
36
+ m && (o.headers.Authorization = m);
37
37
  }
38
- const u = D();
39
- return u && (s.headers.systemId = u), s;
38
+ const u = N();
39
+ return u && (o.headers.systemId = u), o;
40
40
  },
41
- (s) => Promise.reject(s)
41
+ (o) => Promise.reject(o)
42
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;
43
+ (o) => {
44
+ if (o.status !== 200)
45
+ return Promise.reject(new Error(`请求发生错误,状态码 ${o.status}`));
46
+ const { data: u, config: m } = o;
47
47
  if (m.responseType === "arraybuffer" || m.responseType === "blob")
48
48
  return u;
49
49
  if (u && u.code === 0) return u.data;
50
50
  const p = Number(u == null ? void 0 : u.code);
51
51
  if (p === 401 || p === 403)
52
52
  return a(), Promise.reject(new Error("登录失效,请重新登录"));
53
- const b = _(u) || "请求失败", d = new Error(b);
53
+ const b = E(u) || "请求失败", d = new Error(b);
54
54
  return d.code = p, d.data = u == null ? void 0 : u.data, d.biz = u, Promise.reject(d);
55
55
  },
56
- (s) => {
56
+ (o) => {
57
57
  var b, d;
58
- const u = (b = s == null ? void 0 : s.response) == null ? void 0 : b.status;
58
+ const u = (b = o == null ? void 0 : o.response) == null ? void 0 : b.status;
59
59
  if (u === 401 || u === 403)
60
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) || "请求失败";
61
+ const m = (d = o == null ? void 0 : o.response) == null ? void 0 : d.data, p = E(m) || (o == null ? void 0 : o.message) || "请求失败";
62
62
  return Promise.reject(new Error(String(p)));
63
63
  }
64
64
  ), c;
65
65
  }
66
- function _(t) {
66
+ function E(t) {
67
67
  if (t == null) return "";
68
68
  if (typeof t == "string") {
69
69
  const n = t.trim();
@@ -84,36 +84,36 @@ function mt(t = {}) {
84
84
  GET(n, r = {}) {
85
85
  return e({ method: "get", url: n, ...r });
86
86
  },
87
- POST(n, r, o = {}) {
88
- return e({ method: "post", url: n, data: r, ...o });
87
+ POST(n, r, i = {}) {
88
+ return e({ method: "post", url: n, data: r, ...i });
89
89
  },
90
90
  DELETE(n, r = {}) {
91
91
  return e({ method: "delete", url: n, ...r });
92
92
  }
93
93
  };
94
94
  }
95
- const A = "__MGACN_COMMONSDK_REQUEST__";
95
+ const D = "__MGACN_COMMONSDK_REQUEST__";
96
96
  function dt(t) {
97
- globalThis[A] = t;
97
+ globalThis[D] = t;
98
98
  }
99
99
  function L() {
100
- const t = globalThis[A];
100
+ const t = globalThis[D];
101
101
  if (!t)
102
102
  throw new Error("[mgacn-commonsdk] 请先 app.use(MgacnCommonSdk, { tokenKey, baseURL })");
103
103
  return t;
104
104
  }
105
105
  function $(t, e, n = "application/vnd.ms-excel") {
106
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);
107
+ const r = t instanceof Blob ? t : new Blob([t], { type: n }), i = window.URL.createObjectURL(r), s = document.createElement("a");
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 h(t) {
110
+ function y(t) {
111
111
  return String(t).padStart(2, "0");
112
112
  }
113
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())}`;
114
+ return `${t.getFullYear()}${y(t.getMonth() + 1)}${y(t.getDate())}${y(t.getHours())}${y(t.getMinutes())}${y(t.getSeconds())}`;
115
115
  }
116
- async function z(t) {
116
+ async function q(t) {
117
117
  if (!(t instanceof Blob) || !t.type || !/json/i.test(t.type)) return;
118
118
  const e = await t.text();
119
119
  let n = "导出失败";
@@ -124,25 +124,25 @@ async function z(t) {
124
124
  }
125
125
  throw new Error(n);
126
126
  }
127
- async function k(t = {}) {
127
+ async function z(t = {}) {
128
128
  const {
129
129
  url: e,
130
130
  data: n,
131
131
  params: r,
132
- method: o = "POST",
133
- filename: i,
132
+ method: i = "POST",
133
+ filename: s,
134
134
  ext: l = "xlsx"
135
135
  } = t;
136
136
  if (!e) throw new Error("导出地址不能为空");
137
- if (!i) throw new Error("导出文件名不能为空");
138
- const c = L(), f = String(o).toUpperCase();
137
+ if (!s) throw new Error("导出文件名不能为空");
138
+ const c = L(), f = String(i).toUpperCase();
139
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}`;
140
+ f === "GET" ? a = await c.GET(e, { params: r, responseType: "blob" }) : a = await c.POST(e, n, { responseType: "blob" }), await q(a);
141
+ const u = /\.[a-z0-9]+$/i.test(s) ? s : `${s}_${B()}.${l}`;
142
142
  return $(a, u), u;
143
143
  }
144
144
  let g = null;
145
- function q(t, e) {
145
+ function k(t, e) {
146
146
  if (!t || e == null || e === "") return !1;
147
147
  if (typeof e == "object")
148
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();
@@ -157,22 +157,22 @@ function Q() {
157
157
  }
158
158
  function X(t) {
159
159
  if (!Array.isArray(g) || !g.length) return "";
160
- const e = g.find((n) => q(n, t));
160
+ const e = g.find((n) => k(n, t));
161
161
  return (e == null ? void 0 : e.platformLogo) || "";
162
162
  }
163
163
  async function J() {
164
164
  const t = await at().listPlatformInfoAll();
165
165
  return Y(t), g;
166
166
  }
167
- function C(t) {
167
+ function I(t) {
168
168
  const e = String(t || "").trim().toUpperCase();
169
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;
170
+ const a = +`19${e.slice(6, 8)}`, o = Number(e.slice(8, 10)), u = Number(e.slice(10, 12)), m = new Date(a, o - 1, u);
171
+ return m.getFullYear() === a && m.getMonth() + 1 === o && m.getDate() === u;
172
172
  }
173
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;
174
+ 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
+ if (s.getFullYear() !== n || s.getMonth() + 1 !== r || s.getDate() !== i) return !1;
176
176
  const l = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2], c = "10X98765432";
177
177
  let f = 0;
178
178
  for (let a = 0; a < 17; a++) f += Number(e[a]) * l[a];
@@ -186,22 +186,22 @@ function P(t) {
186
186
  const e = String(t || "").trim();
187
187
  return e ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) : !1;
188
188
  }
189
- function w(t) {
189
+ function _(t) {
190
190
  return t == null || t === "";
191
191
  }
192
192
  function Z(t, e, n) {
193
- if (w(e)) {
193
+ if (_(e)) {
194
194
  n();
195
195
  return;
196
196
  }
197
- if (!C(e)) {
197
+ if (!I(e)) {
198
198
  n(new Error("请输入正确的身份证号(15/18位)"));
199
199
  return;
200
200
  }
201
201
  n();
202
202
  }
203
203
  function V(t, e, n) {
204
- if (w(e)) {
204
+ if (_(e)) {
205
205
  n();
206
206
  return;
207
207
  }
@@ -212,7 +212,7 @@ function V(t, e, n) {
212
212
  n();
213
213
  }
214
214
  function W(t, e, n) {
215
- if (w(e)) {
215
+ if (_(e)) {
216
216
  n();
217
217
  return;
218
218
  }
@@ -225,166 +225,166 @@ function W(t, e, n) {
225
225
  function v(t) {
226
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
227
  }
228
- function N(t) {
228
+ function S(t) {
229
229
  if (t === null || typeof t != "object") return t;
230
230
  if (t instanceof Date) return new Date(t.getTime());
231
- if (Array.isArray(t)) return t.map((n) => N(n));
231
+ if (Array.isArray(t)) return t.map((n) => S(n));
232
232
  const e = {};
233
233
  return Object.keys(t).forEach((n) => {
234
- e[n] = N(t[n]);
234
+ e[n] = S(t[n]);
235
235
  }), e;
236
236
  }
237
237
  function tt(t, e = 300) {
238
238
  let n = null;
239
- return function(...o) {
239
+ return function(...i) {
240
240
  n && clearTimeout(n), n = setTimeout(() => {
241
- t.apply(this, o);
241
+ t.apply(this, i);
242
242
  }, e);
243
243
  };
244
244
  }
245
245
  function et(t, e = 300) {
246
246
  let n = 0;
247
- return function(...o) {
248
- const i = Date.now();
249
- i - n >= e && (n = i, t.apply(this, o));
247
+ return function(...i) {
248
+ const s = Date.now();
249
+ s - n >= e && (n = s, t.apply(this, i));
250
250
  };
251
251
  }
252
- function I(t) {
252
+ function C(t) {
253
253
  if (t == null || t === "") return null;
254
254
  if (t instanceof Date)
255
255
  return Number.isNaN(t.getTime()) ? null : t;
256
256
  if (typeof t == "number") {
257
- const o = new Date(t);
258
- return Number.isNaN(o.getTime()) ? null : o;
257
+ const i = new Date(t);
258
+ return Number.isNaN(i.getTime()) ? null : i;
259
259
  }
260
260
  const e = String(t).trim();
261
261
  if (!e) return null;
262
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;
263
+ const i = e.length === 10 ? Number(e) * 1e3 : Number(e), s = new Date(i);
264
+ return Number.isNaN(s.getTime()) ? null : s;
265
265
  }
266
266
  if (/[Zz]$|[+-]\d{2}:?\d{2}$/.test(e)) {
267
- const o = new Date(e);
268
- return Number.isNaN(o.getTime()) ? null : o;
267
+ const i = new Date(e);
268
+ return Number.isNaN(i.getTime()) ? null : i;
269
269
  }
270
270
  const n = e.match(
271
271
  /^(\d{4})[-/.年](\d{1,2})[-/.月](\d{1,2})日?(?:[\sT]+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\.(\d{1,3}))?)?/
272
272
  );
273
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,
274
+ const [, i, s, l, c = "0", f = "0", a = "0", o = "0"] = n, u = new Date(
275
+ Number(i),
276
+ Number(s) - 1,
277
277
  Number(l),
278
278
  Number(c),
279
279
  Number(f),
280
280
  Number(a),
281
- Number(String(s).padEnd(3, "0"))
281
+ Number(String(o).padEnd(3, "0"))
282
282
  );
283
283
  return Number.isNaN(u.getTime()) ? null : u;
284
284
  }
285
285
  const r = new Date(e);
286
286
  return Number.isNaN(r.getTime()) ? null : r;
287
287
  }
288
- function y(t, e = "YYYY-MM-DD HH:mm:ss") {
289
- const n = I(t);
288
+ function T(t, e = "YYYY-MM-DD HH:mm:ss") {
289
+ const n = C(t);
290
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 = {
291
+ const r = n.getFullYear(), i = n.getMonth() + 1, s = n.getDate(), l = n.getHours(), c = n.getMinutes(), f = n.getSeconds(), a = {
292
292
  YYYY: String(r),
293
- MM: String(o).padStart(2, "0"),
294
- DD: String(i).padStart(2, "0"),
293
+ MM: String(i).padStart(2, "0"),
294
+ DD: String(s).padStart(2, "0"),
295
295
  HH: String(l).padStart(2, "0"),
296
296
  mm: String(c).padStart(2, "0"),
297
297
  ss: String(f).padStart(2, "0"),
298
- M: String(o),
299
- D: String(i),
298
+ M: String(i),
299
+ D: String(s),
300
300
  H: String(l),
301
301
  m: String(c),
302
302
  s: String(f)
303
303
  };
304
- return e.replace(/YYYY|MM|DD|HH|mm|ss|M|D|H|m|s/g, (s) => a[s]);
304
+ return e.replace(/YYYY|MM|DD|HH|mm|ss|M|D|H|m|s/g, (o) => a[o]);
305
305
  }
306
306
  function nt() {
307
307
  const t = /* @__PURE__ */ new Date();
308
308
  t.setHours(23, 59, 59, 0);
309
309
  const e = /* @__PURE__ */ new Date();
310
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")
311
+ start: T(e, "YYYY-MM-DD HH:mm:ss"),
312
+ end: T(t, "YYYY-MM-DD HH:mm:ss")
313
313
  };
314
314
  }
315
- function S(t) {
315
+ function h(t) {
316
316
  const e = {};
317
317
  return Object.keys(t || {}).forEach((n) => {
318
318
  const r = t[n];
319
319
  r == null || r === "" || Array.isArray(r) && r.length === 0 || (e[n] = r);
320
320
  }), e;
321
321
  }
322
- function T(t, e = 2) {
322
+ function w(t, e = 2) {
323
323
  if (t == null || t === "") return t;
324
324
  const n = Number(t);
325
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+$/, "");
326
+ const r = n.toFixed(e), [i, s] = r.split("."), l = i.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
327
+ if (s == null) return l;
328
+ const c = s.replace(/0+$/, "");
329
329
  return c ? `${l}.${c}` : l;
330
330
  }
331
331
  function rt(t) {
332
332
  if (t == null || t === "") return "-";
333
333
  const e = Number(t);
334
- return Number.isNaN(e) ? "-" : Math.abs(e) > 1e4 ? `${T(e / 1e4, 2)}w` : String(T(e, 0));
334
+ return Number.isNaN(e) ? "-" : Math.abs(e) > 1e4 ? `${w(e / 1e4, 2)}w` : String(w(e, 0));
335
335
  }
336
- function x(t) {
336
+ function R(t) {
337
337
  if (t == null || t === "") return t;
338
338
  const e = Number(t);
339
339
  return !Number.isFinite(e) || Number.isNaN(e) ? t : e === 0 ? 0 : Number(String((e * 100).toFixed(2)).replace(/(?:\.0*|(\.\d+?)0+)$/, "$1"));
340
340
  }
341
341
  function it(t) {
342
342
  if (t == null || t === "") return "-";
343
- const e = x(t);
343
+ const e = R(t);
344
344
  return e == null || e === "" || Number.isNaN(Number(e)) ? "-" : `${e}%`;
345
345
  }
346
- function ot(t, e = 4) {
346
+ function st(t, e = 4) {
347
347
  if (t === "" || t == null) return;
348
348
  const n = Number(t);
349
349
  if (Number.isFinite(n))
350
350
  return Number((n / 100).toFixed(e));
351
351
  }
352
- function st(t, e = 2, n = 1e9) {
352
+ function ot(t, e = 2, n = 1e9) {
353
353
  if (t === 0 || t === "0") return 0;
354
354
  if (t == null || t === "") return "";
355
355
  let r = Number(t);
356
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));
357
+ const i = Number(n), s = Number.isFinite(i) ? Math.abs(i) : 1e9;
358
+ return Math.abs(r) >= s && (r = r < 0 ? -s : s), Number.isInteger(r) ? r : Number(r.toFixed(e));
359
359
  }
360
360
  function ut(t = "id") {
361
361
  return `${t}_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
362
362
  }
363
363
  const gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
364
364
  __proto__: null,
365
- cleanNumber: st,
366
- cleanParams: S,
365
+ cleanNumber: ot,
366
+ cleanParams: h,
367
367
  clearPlatformCache: Q,
368
368
  debounce: tt,
369
- deepClone: N,
369
+ deepClone: S,
370
370
  downloadBlob: $,
371
- exportFile: k,
371
+ exportFile: z,
372
372
  findPlatformLogo: X,
373
- formatDate: y,
373
+ formatDate: T,
374
374
  formatFansCount: rt,
375
- formatNum: T,
375
+ formatNum: w,
376
376
  getRecentMonthRange: nt,
377
377
  isEmail: P,
378
378
  isEmpty: v,
379
- isMainlandIdCard: C,
379
+ isMainlandIdCard: I,
380
380
  isMobile: O,
381
- numberRatio: x,
381
+ numberRatio: R,
382
382
  numberRatioText: it,
383
- parseDate: I,
383
+ parseDate: C,
384
384
  preloadPlatformList: J,
385
385
  setPlatformCache: Y,
386
386
  throttle: et,
387
- toRebateRatio: ot,
387
+ toRebateRatio: st,
388
388
  uniqueId: ut,
389
389
  validateEmail: W,
390
390
  validateIdCardNo: Z,
@@ -419,9 +419,26 @@ function pt(t) {
419
419
  * @returns {Promise<Array>} 用户列表(兼容 result / list / 直接数组)
420
420
  */
421
421
  async listUserForSelect(e = {}) {
422
- const n = await t.POST("/yhAdmin/user/listForSelect", S(e));
422
+ const n = await t.POST("/yhAdmin/user/listForSelect", h(e));
423
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
424
  },
425
+ /**
426
+ * 按角色名称查询用户列表(下拉)
427
+ * POST /yhAdmin/user/queryUserByRoleName
428
+ * systemId 由组件库自动填充,宿主勿传
429
+ * @param {object} params
430
+ * @param {string} params.roleName 角色名称
431
+ */
432
+ async queryByRoleName(e = {}) {
433
+ const { systemId: n, ...r } = e && typeof e == "object" ? e : {}, i = await t.POST(
434
+ "/yhAdmin/user/queryUserByRoleName",
435
+ h({
436
+ ...r,
437
+ systemId: N()
438
+ })
439
+ );
440
+ 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 : [];
441
+ },
425
442
  /**
426
443
  * 媒介供应商全量列表(下拉)
427
444
  * GET /yhAccount/mediaSupplier/listAll
@@ -444,7 +461,7 @@ function pt(t) {
444
461
  */
445
462
  queryAllTagConfigs(e = {}) {
446
463
  return t.GET("/yhShared/tagConfig/queryAllTagConfigs", {
447
- params: S(e)
464
+ params: h(e)
448
465
  });
449
466
  },
450
467
  /**
@@ -457,13 +474,13 @@ function pt(t) {
457
474
  * @param {string} [params.wxUserId] 微信用户 ID
458
475
  */
459
476
  addTraceData(e = {}) {
460
- const { userId: n, projectId: r, clientType: o, ...i } = e && typeof e == "object" ? e : {};
477
+ const { userId: n, projectId: r, clientType: i, ...s } = e && typeof e == "object" ? e : {};
461
478
  return t.POST(
462
479
  "/yhAdmin/trace/addTraceData",
463
- S({
464
- ...i,
480
+ h({
481
+ ...s,
465
482
  userId: H(),
466
- projectId: D(),
483
+ projectId: N(),
467
484
  clientType: 1
468
485
  })
469
486
  );
@@ -474,37 +491,37 @@ function pt(t) {
474
491
  }
475
492
  };
476
493
  }
477
- const R = "__MGACN_COMMONSDK_API__";
478
- function ht(t) {
479
- globalThis[R] = t;
494
+ const x = "__MGACN_COMMONSDK_API__";
495
+ function yt(t) {
496
+ globalThis[x] = t;
480
497
  }
481
498
  function at() {
482
- const t = globalThis[R];
499
+ const t = globalThis[x];
483
500
  if (!t)
484
501
  throw new Error("[mgacn-commonsdk] 请先 app.use(MgacnCommonSdk, { tokenKey, baseURL })");
485
502
  return t;
486
503
  }
487
504
  const j = "__MGACN_COMMONSDK_PERMISSION_GETTER__";
488
- function bt(t) {
505
+ function ht(t) {
489
506
  globalThis[j] = typeof t == "function" ? t : null;
490
507
  }
491
508
  function ct() {
492
509
  return globalThis[j] || null;
493
510
  }
494
511
  function lt(t, e, n = "and") {
495
- const r = (Array.isArray(e) ? e : [e]).map((i) => String(i ?? "").trim()).filter(Boolean);
512
+ const r = (Array.isArray(e) ? e : [e]).map((s) => String(s ?? "").trim()).filter(Boolean);
496
513
  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));
514
+ const i = new Set((t || []).map(String));
515
+ return n === "or" ? r.some((s) => i.has(s)) : r.every((s) => i.has(s));
499
516
  }
500
- function St(t, e = "and") {
517
+ function bt(t, e = "and") {
501
518
  const n = ct();
502
519
  return typeof n != "function" ? !0 : lt(n(), t, e);
503
520
  }
504
521
  const Nt = (t, e) => {
505
522
  const n = t.__vccOpts || t;
506
- for (const [r, o] of e)
507
- n[r] = o;
523
+ for (const [r, i] of e)
524
+ n[r] = i;
508
525
  return n;
509
526
  };
510
527
  export {
@@ -512,20 +529,20 @@ export {
512
529
  G as a,
513
530
  L as b,
514
531
  lt as c,
515
- N as d,
516
- S as e,
532
+ S as d,
533
+ h as e,
517
534
  tt as f,
518
535
  at as g,
519
- T as h,
520
- St as i,
521
- bt as j,
536
+ w as h,
537
+ bt as i,
538
+ ht as j,
522
539
  mt as k,
523
540
  pt as l,
524
541
  dt as m,
525
- ht as n,
542
+ yt as n,
526
543
  K as o,
527
544
  ct as p,
528
- D as q,
545
+ N as q,
529
546
  H as r,
530
547
  F as s,
531
548
  gt as t