@das-fed/utils 7.0.7-hot.7 → 7.0.7-hot.8
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/api-services/modules/app-manage/index.js +725 -743
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +725 -743
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +728 -746
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.js +725 -743
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +734 -752
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +743 -725
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +626 -630
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +743 -725
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +717 -699
- package/api-services/src/create-service/index.js.gz +0 -0
- package/create-api-service/sso/index.js +86 -87
- package/create-api-service/sso/index.js.gz +0 -0
- package/package.json +4 -4
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { unref as Nt, getCurrentScope as Ft, onScopeDispose as Dt, ref as
|
|
1
|
+
import { unref as Nt, getCurrentScope as Ft, onScopeDispose as Dt, ref as Y, watch as Oe } from "vue";
|
|
2
2
|
import { encryption as vt } from "@das-fed/utils/atob";
|
|
3
3
|
import { getConfig as Ae } from "@das-fed/utils/config";
|
|
4
|
-
import { getAccessToken as M, removeAccessToken as It, setAccessToken as Bt, getAccessTokenInfo as
|
|
4
|
+
import { getAccessToken as M, removeAccessToken as It, setAccessToken as Bt, getAccessTokenInfo as le } from "@das-fed/utils/token-tools";
|
|
5
5
|
import { appendQueryParams as jt } from "@das-fed/utils/common-tools";
|
|
6
6
|
import { removeProcessEngineToken as qt, setProcessEngineToken as Mt } from "@das-fed/utils/process-engine-info";
|
|
7
7
|
import { setPersonalInfo as tt } from "@das-fed/utils/common-info/set-personal-info";
|
|
@@ -10,10 +10,10 @@ function nt(e, t) {
|
|
|
10
10
|
return e.apply(t, arguments);
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
const { toString: Ht } = Object.prototype, { getPrototypeOf: _e } = Object, { iterator:
|
|
13
|
+
const { toString: Ht } = Object.prototype, { getPrototypeOf: _e } = Object, { iterator: re, toStringTag: rt } = Symbol, oe = /* @__PURE__ */ ((e) => (t) => {
|
|
14
14
|
const n = Ht.call(t);
|
|
15
15
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
16
|
-
})(/* @__PURE__ */ Object.create(null)), x = (e) => (e = e.toLowerCase(), (t) =>
|
|
16
|
+
})(/* @__PURE__ */ Object.create(null)), x = (e) => (e = e.toLowerCase(), (t) => oe(t) === e), se = (e) => (t) => typeof t === e, { isArray: v } = Array, H = se("undefined");
|
|
17
17
|
function z(e) {
|
|
18
18
|
return e !== null && !H(e) && e.constructor !== null && !H(e.constructor) && A(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
19
19
|
}
|
|
@@ -22,11 +22,11 @@ function $t(e) {
|
|
|
22
22
|
let t;
|
|
23
23
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && ot(e.buffer), t;
|
|
24
24
|
}
|
|
25
|
-
const zt =
|
|
26
|
-
if (
|
|
25
|
+
const zt = se("string"), A = se("function"), st = se("number"), J = (e) => e !== null && typeof e == "object", Jt = (e) => e === !0 || e === !1, X = (e) => {
|
|
26
|
+
if (oe(e) !== "object")
|
|
27
27
|
return !1;
|
|
28
28
|
const t = _e(e);
|
|
29
|
-
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(rt in e) && !(
|
|
29
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(rt in e) && !(re in e);
|
|
30
30
|
}, Vt = (e) => {
|
|
31
31
|
if (!J(e) || z(e))
|
|
32
32
|
return !1;
|
|
@@ -37,7 +37,7 @@ const zt = ie("string"), A = ie("function"), st = ie("number"), J = (e) => e !==
|
|
|
37
37
|
}
|
|
38
38
|
}, Wt = x("Date"), Kt = x("File"), Qt = x("Blob"), Xt = x("FileList"), Gt = (e) => J(e) && A(e.pipe), Zt = (e) => {
|
|
39
39
|
let t;
|
|
40
|
-
return e && (typeof FormData == "function" && e instanceof FormData || A(e.append) && ((t =
|
|
40
|
+
return e && (typeof FormData == "function" && e instanceof FormData || A(e.append) && ((t = oe(e)) === "formdata" || // detect form-data instance
|
|
41
41
|
t === "object" && A(e.toString) && e.toString() === "[object FormData]"));
|
|
42
42
|
}, Yt = x("URLSearchParams"), [en, tn, nn, rn] = ["ReadableStream", "Request", "Response", "Headers"].map(x), on = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
43
43
|
function V(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
@@ -71,7 +71,7 @@ const L = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : type
|
|
|
71
71
|
function me() {
|
|
72
72
|
const { caseless: e } = at(this) && this || {}, t = {}, n = (r, o) => {
|
|
73
73
|
const s = e && it(t, o) || o;
|
|
74
|
-
|
|
74
|
+
X(t[s]) && X(r) ? t[s] = me(t[s], r) : X(r) ? t[s] = me({}, r) : v(r) ? t[s] = r.slice() : t[s] = r;
|
|
75
75
|
};
|
|
76
76
|
for (let r = 0, o = arguments.length; r < o; r++)
|
|
77
77
|
arguments[r] && V(arguments[r], n);
|
|
@@ -107,7 +107,7 @@ const sn = (e, t, n, { allOwnKeys: r } = {}) => (V(t, (o, s) => {
|
|
|
107
107
|
n[t] = e[t];
|
|
108
108
|
return n;
|
|
109
109
|
}, dn = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && _e(Uint8Array)), pn = (e, t) => {
|
|
110
|
-
const r = (e && e[
|
|
110
|
+
const r = (e && e[re]).call(e);
|
|
111
111
|
let o;
|
|
112
112
|
for (; (o = r.next()) && !o.done; ) {
|
|
113
113
|
const s = o.value;
|
|
@@ -155,7 +155,7 @@ const sn = (e, t, n, { allOwnKeys: r } = {}) => (V(t, (o, s) => {
|
|
|
155
155
|
}, En = () => {
|
|
156
156
|
}, Sn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
157
157
|
function Rn(e) {
|
|
158
|
-
return !!(e && A(e.append) && e[rt] === "FormData" && e[
|
|
158
|
+
return !!(e && A(e.append) && e[rt] === "FormData" && e[re]);
|
|
159
159
|
}
|
|
160
160
|
const Tn = (e) => {
|
|
161
161
|
const t = new Array(10), n = (r, o) => {
|
|
@@ -183,7 +183,7 @@ const Tn = (e) => {
|
|
|
183
183
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
184
184
|
typeof setImmediate == "function",
|
|
185
185
|
A(L.postMessage)
|
|
186
|
-
), _n = typeof queueMicrotask < "u" ? queueMicrotask.bind(L) : typeof process < "u" && process.nextTick || ut, xn = (e) => e != null && A(e[
|
|
186
|
+
), _n = typeof queueMicrotask < "u" ? queueMicrotask.bind(L) : typeof process < "u" && process.nextTick || ut, xn = (e) => e != null && A(e[re]), a = {
|
|
187
187
|
isArray: v,
|
|
188
188
|
isArrayBuffer: ot,
|
|
189
189
|
isBuffer: z,
|
|
@@ -193,7 +193,7 @@ const Tn = (e) => {
|
|
|
193
193
|
isNumber: st,
|
|
194
194
|
isBoolean: Jt,
|
|
195
195
|
isObject: J,
|
|
196
|
-
isPlainObject:
|
|
196
|
+
isPlainObject: X,
|
|
197
197
|
isEmptyObject: Vt,
|
|
198
198
|
isReadableStream: en,
|
|
199
199
|
isRequest: tn,
|
|
@@ -216,7 +216,7 @@ const Tn = (e) => {
|
|
|
216
216
|
stripBOM: an,
|
|
217
217
|
inherits: cn,
|
|
218
218
|
toFlatObject: un,
|
|
219
|
-
kindOf:
|
|
219
|
+
kindOf: oe,
|
|
220
220
|
kindOfTest: x,
|
|
221
221
|
endsWith: ln,
|
|
222
222
|
toArray: fn,
|
|
@@ -311,7 +311,7 @@ function Cn(e) {
|
|
|
311
311
|
const Pn = a.toFlatObject(a, {}, null, function(t) {
|
|
312
312
|
return /^is[A-Z]/.test(t);
|
|
313
313
|
});
|
|
314
|
-
function
|
|
314
|
+
function ie(e, t, n) {
|
|
315
315
|
if (!a.isObject(e))
|
|
316
316
|
throw new TypeError("target must be an object");
|
|
317
317
|
t = t || new FormData(), n = a.toFlatObject(n, {
|
|
@@ -389,7 +389,7 @@ function Ne(e) {
|
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
391
|
function xe(e, t) {
|
|
392
|
-
this._pairs = [], e &&
|
|
392
|
+
this._pairs = [], e && ie(e, this, t);
|
|
393
393
|
}
|
|
394
394
|
const pt = xe.prototype;
|
|
395
395
|
pt.append = function(t, n) {
|
|
@@ -500,7 +500,7 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Bn
|
|
|
500
500
|
...Dn
|
|
501
501
|
};
|
|
502
502
|
function qn(e, t) {
|
|
503
|
-
return
|
|
503
|
+
return ie(e, new T.classes.URLSearchParams(), {
|
|
504
504
|
visitor: function(n, r, o, s) {
|
|
505
505
|
return T.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
506
506
|
},
|
|
@@ -563,7 +563,7 @@ const W = {
|
|
|
563
563
|
return qn(t, this.formSerializer).toString();
|
|
564
564
|
if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
565
565
|
const f = this.env && this.env.FormData;
|
|
566
|
-
return
|
|
566
|
+
return ie(
|
|
567
567
|
c ? { "files[]": t } : t,
|
|
568
568
|
f && new f(),
|
|
569
569
|
this.formSerializer
|
|
@@ -642,8 +642,8 @@ const zn = a.toObjectSet([
|
|
|
642
642
|
function B(e) {
|
|
643
643
|
return e && String(e).trim().toLowerCase();
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
return e === !1 || e == null ? e : a.isArray(e) ? e.map(
|
|
645
|
+
function G(e) {
|
|
646
|
+
return e === !1 || e == null ? e : a.isArray(e) ? e.map(G) : String(e);
|
|
647
647
|
}
|
|
648
648
|
function Vn(e) {
|
|
649
649
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
@@ -653,7 +653,7 @@ function Vn(e) {
|
|
|
653
653
|
return t;
|
|
654
654
|
}
|
|
655
655
|
const Wn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
656
|
-
function
|
|
656
|
+
function fe(e, t, n, r, o) {
|
|
657
657
|
if (a.isFunction(r))
|
|
658
658
|
return r.call(this, t, n);
|
|
659
659
|
if (o && (t = n), !!a.isString(t)) {
|
|
@@ -688,7 +688,7 @@ let _ = class {
|
|
|
688
688
|
if (!u)
|
|
689
689
|
throw new Error("header name must be a non-empty string");
|
|
690
690
|
const d = a.findKey(o, u);
|
|
691
|
-
(!d || o[d] === void 0 || l === !0 || l === void 0 && o[d] !== !1) && (o[d || f] =
|
|
691
|
+
(!d || o[d] === void 0 || l === !0 || l === void 0 && o[d] !== !1) && (o[d || f] = G(c));
|
|
692
692
|
}
|
|
693
693
|
const i = (c, f) => a.forEach(c, (l, u) => s(l, u, f));
|
|
694
694
|
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
@@ -727,7 +727,7 @@ let _ = class {
|
|
|
727
727
|
has(t, n) {
|
|
728
728
|
if (t = B(t), t) {
|
|
729
729
|
const r = a.findKey(this, t);
|
|
730
|
-
return !!(r && this[r] !== void 0 && (!n ||
|
|
730
|
+
return !!(r && this[r] !== void 0 && (!n || fe(this, this[r], r, n)));
|
|
731
731
|
}
|
|
732
732
|
return !1;
|
|
733
733
|
}
|
|
@@ -737,7 +737,7 @@ let _ = class {
|
|
|
737
737
|
function s(i) {
|
|
738
738
|
if (i = B(i), i) {
|
|
739
739
|
const c = a.findKey(r, i);
|
|
740
|
-
c && (!n ||
|
|
740
|
+
c && (!n || fe(r, r[c], c, n)) && (delete r[c], o = !0);
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
743
|
return a.isArray(t) ? t.forEach(s) : s(t), o;
|
|
@@ -747,7 +747,7 @@ let _ = class {
|
|
|
747
747
|
let r = n.length, o = !1;
|
|
748
748
|
for (; r--; ) {
|
|
749
749
|
const s = n[r];
|
|
750
|
-
(!t ||
|
|
750
|
+
(!t || fe(this, this[s], s, t, !0)) && (delete this[s], o = !0);
|
|
751
751
|
}
|
|
752
752
|
return o;
|
|
753
753
|
}
|
|
@@ -756,11 +756,11 @@ let _ = class {
|
|
|
756
756
|
return a.forEach(this, (o, s) => {
|
|
757
757
|
const i = a.findKey(r, s);
|
|
758
758
|
if (i) {
|
|
759
|
-
n[i] =
|
|
759
|
+
n[i] = G(o), delete n[s];
|
|
760
760
|
return;
|
|
761
761
|
}
|
|
762
762
|
const c = t ? Kn(s) : String(s).trim();
|
|
763
|
-
c !== s && delete n[s], n[c] =
|
|
763
|
+
c !== s && delete n[s], n[c] = G(o), r[c] = !0;
|
|
764
764
|
}), this;
|
|
765
765
|
}
|
|
766
766
|
concat(...t) {
|
|
@@ -814,7 +814,7 @@ a.reduceDescriptors(_.prototype, ({ value: e }, t) => {
|
|
|
814
814
|
};
|
|
815
815
|
});
|
|
816
816
|
a.freezeMethods(_);
|
|
817
|
-
function
|
|
817
|
+
function de(e, t) {
|
|
818
818
|
const n = this || W, r = t || n, o = _.from(r.headers);
|
|
819
819
|
let s = r.data;
|
|
820
820
|
return a.forEach(e, function(c) {
|
|
@@ -872,7 +872,7 @@ function Zn(e, t) {
|
|
|
872
872
|
}, r - d)));
|
|
873
873
|
}, () => o && i(o)];
|
|
874
874
|
}
|
|
875
|
-
const
|
|
875
|
+
const ee = (e, t, n = 3) => {
|
|
876
876
|
let r = 0;
|
|
877
877
|
const o = Gn(50, 250);
|
|
878
878
|
return Zn((s) => {
|
|
@@ -1071,7 +1071,7 @@ const Et = (e) => {
|
|
|
1071
1071
|
)), h = null;
|
|
1072
1072
|
}, s === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(C, O) {
|
|
1073
1073
|
h.setRequestHeader(O, C);
|
|
1074
|
-
}), a.isUndefined(o.withCredentials) || (h.withCredentials = !!o.withCredentials), c && c !== "json" && (h.responseType = o.responseType), l && ([w, p] =
|
|
1074
|
+
}), a.isUndefined(o.withCredentials) || (h.withCredentials = !!o.withCredentials), c && c !== "json" && (h.responseType = o.responseType), l && ([w, p] = ee(l, !0), h.addEventListener("progress", w)), f && h.upload && ([d, g] = ee(f), h.upload.addEventListener("progress", d), h.upload.addEventListener("loadend", g)), (o.cancelToken || o.signal) && (u = (R) => {
|
|
1075
1075
|
h && (r(!R || R.type ? new I(null, e, h) : R), h.abort(), h = null);
|
|
1076
1076
|
}, o.cancelToken && o.cancelToken.subscribe(u), o.signal && (o.signal.aborted ? u() : o.signal.addEventListener("abort", u)));
|
|
1077
1077
|
const S = Xn(o.url);
|
|
@@ -1161,7 +1161,7 @@ const Et = (e) => {
|
|
|
1161
1161
|
}, {
|
|
1162
1162
|
highWaterMark: 2
|
|
1163
1163
|
});
|
|
1164
|
-
},
|
|
1164
|
+
}, ae = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", St = ae && typeof ReadableStream == "function", ur = ae && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), Rt = (e, ...t) => {
|
|
1165
1165
|
try {
|
|
1166
1166
|
return !!e(...t);
|
|
1167
1167
|
} catch {
|
|
@@ -1177,12 +1177,12 @@ const Et = (e) => {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
}).headers.has("Content-Type");
|
|
1179
1179
|
return e && !t;
|
|
1180
|
-
}), qe = 64 * 1024, ge = St && Rt(() => a.isReadableStream(new Response("").body)),
|
|
1180
|
+
}), qe = 64 * 1024, ge = St && Rt(() => a.isReadableStream(new Response("").body)), te = {
|
|
1181
1181
|
stream: ge && ((e) => e.body)
|
|
1182
1182
|
};
|
|
1183
|
-
|
|
1183
|
+
ae && ((e) => {
|
|
1184
1184
|
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
|
|
1185
|
-
!
|
|
1185
|
+
!te[t] && (te[t] = a.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
|
|
1186
1186
|
throw new y(`Response type '${t}' is not supported`, y.ERR_NOT_SUPPORT, r);
|
|
1187
1187
|
});
|
|
1188
1188
|
});
|
|
@@ -1204,7 +1204,7 @@ const fr = async (e) => {
|
|
|
1204
1204
|
}, dr = async (e, t) => {
|
|
1205
1205
|
const n = a.toFiniteNumber(e.getContentLength());
|
|
1206
1206
|
return n ?? fr(t);
|
|
1207
|
-
}, pr =
|
|
1207
|
+
}, pr = ae && (async (e) => {
|
|
1208
1208
|
let {
|
|
1209
1209
|
url: t,
|
|
1210
1210
|
method: n,
|
|
@@ -1235,7 +1235,7 @@ const fr = async (e) => {
|
|
|
1235
1235
|
if (a.isFormData(r) && (P = O.headers.get("content-type")) && u.setContentType(P), O.body) {
|
|
1236
1236
|
const [U, K] = ve(
|
|
1237
1237
|
h,
|
|
1238
|
-
|
|
1238
|
+
ee(Ie(f))
|
|
1239
1239
|
);
|
|
1240
1240
|
r = je(O.body, qe, U, K);
|
|
1241
1241
|
}
|
|
@@ -1260,7 +1260,7 @@ const fr = async (e) => {
|
|
|
1260
1260
|
});
|
|
1261
1261
|
const P = a.toFiniteNumber(S.headers.get("content-length")), [U, K] = c && ve(
|
|
1262
1262
|
P,
|
|
1263
|
-
|
|
1263
|
+
ee(Ie(c), !0)
|
|
1264
1264
|
) || [];
|
|
1265
1265
|
S = new Response(
|
|
1266
1266
|
je(S.body, qe, U, () => {
|
|
@@ -1270,7 +1270,7 @@ const fr = async (e) => {
|
|
|
1270
1270
|
);
|
|
1271
1271
|
}
|
|
1272
1272
|
l = l || "text";
|
|
1273
|
-
let C = await
|
|
1273
|
+
let C = await te[a.findKey(te, l) || "text"](S, e);
|
|
1274
1274
|
return !R && m && m(), await new Promise((O, P) => {
|
|
1275
1275
|
gt(O, P, {
|
|
1276
1276
|
data: C,
|
|
@@ -1334,36 +1334,36 @@ const Me = (e) => `- ${e}`, hr = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1334
1334
|
},
|
|
1335
1335
|
adapters: be
|
|
1336
1336
|
};
|
|
1337
|
-
function
|
|
1337
|
+
function pe(e) {
|
|
1338
1338
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1339
1339
|
throw new I(null, e);
|
|
1340
1340
|
}
|
|
1341
1341
|
function He(e) {
|
|
1342
|
-
return
|
|
1342
|
+
return pe(e), e.headers = _.from(e.headers), e.data = de.call(
|
|
1343
1343
|
e,
|
|
1344
1344
|
e.transformRequest
|
|
1345
1345
|
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Tt.getAdapter(e.adapter || W.adapter)(e).then(function(r) {
|
|
1346
|
-
return
|
|
1346
|
+
return pe(e), r.data = de.call(
|
|
1347
1347
|
e,
|
|
1348
1348
|
e.transformResponse,
|
|
1349
1349
|
r
|
|
1350
1350
|
), r.headers = _.from(r.headers), r;
|
|
1351
1351
|
}, function(r) {
|
|
1352
|
-
return wt(r) || (
|
|
1352
|
+
return wt(r) || (pe(e), r && r.response && (r.response.data = de.call(
|
|
1353
1353
|
e,
|
|
1354
1354
|
e.transformResponse,
|
|
1355
1355
|
r.response
|
|
1356
1356
|
), r.response.headers = _.from(r.response.headers))), Promise.reject(r);
|
|
1357
1357
|
});
|
|
1358
1358
|
}
|
|
1359
|
-
const Ot = "1.11.0",
|
|
1359
|
+
const Ot = "1.11.0", ce = {};
|
|
1360
1360
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1361
|
-
|
|
1361
|
+
ce[e] = function(r) {
|
|
1362
1362
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1363
1363
|
};
|
|
1364
1364
|
});
|
|
1365
1365
|
const $e = {};
|
|
1366
|
-
|
|
1366
|
+
ce.transitional = function(t, n, r) {
|
|
1367
1367
|
function o(s, i) {
|
|
1368
1368
|
return "[Axios v" + Ot + "] Transitional option '" + s + "'" + i + (r ? ". " + r : "");
|
|
1369
1369
|
}
|
|
@@ -1376,7 +1376,7 @@ ue.transitional = function(t, n, r) {
|
|
|
1376
1376
|
return n && !$e[i] && ($e[i] = !0), t ? t(s, i, c) : !0;
|
|
1377
1377
|
};
|
|
1378
1378
|
};
|
|
1379
|
-
|
|
1379
|
+
ce.spelling = function(t) {
|
|
1380
1380
|
return (n, r) => !0;
|
|
1381
1381
|
};
|
|
1382
1382
|
function mr(e, t, n) {
|
|
@@ -1396,10 +1396,10 @@ function mr(e, t, n) {
|
|
|
1396
1396
|
throw new y("Unknown option " + s, y.ERR_BAD_OPTION);
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
|
-
const
|
|
1399
|
+
const Z = {
|
|
1400
1400
|
assertOptions: mr,
|
|
1401
|
-
validators:
|
|
1402
|
-
}, k =
|
|
1401
|
+
validators: ce
|
|
1402
|
+
}, k = Z.validators;
|
|
1403
1403
|
let N = class {
|
|
1404
1404
|
constructor(t) {
|
|
1405
1405
|
this.defaults = t || {}, this.interceptors = {
|
|
@@ -1435,16 +1435,16 @@ let N = class {
|
|
|
1435
1435
|
_request(t, n) {
|
|
1436
1436
|
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = F(this.defaults, n);
|
|
1437
1437
|
const { transitional: r, paramsSerializer: o, headers: s } = n;
|
|
1438
|
-
r !== void 0 &&
|
|
1438
|
+
r !== void 0 && Z.assertOptions(r, {
|
|
1439
1439
|
silentJSONParsing: k.transitional(k.boolean),
|
|
1440
1440
|
forcedJSONParsing: k.transitional(k.boolean),
|
|
1441
1441
|
clarifyTimeoutError: k.transitional(k.boolean)
|
|
1442
1442
|
}, !1), o != null && (a.isFunction(o) ? n.paramsSerializer = {
|
|
1443
1443
|
serialize: o
|
|
1444
|
-
} :
|
|
1444
|
+
} : Z.assertOptions(o, {
|
|
1445
1445
|
encode: k.function,
|
|
1446
1446
|
serialize: k.function
|
|
1447
|
-
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0),
|
|
1447
|
+
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Z.assertOptions(n, {
|
|
1448
1448
|
baseUrl: k.spelling("baseURL"),
|
|
1449
1449
|
withXsrfToken: k.spelling("withXSRFToken")
|
|
1450
1450
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
@@ -1685,7 +1685,7 @@ b.CanceledError = I;
|
|
|
1685
1685
|
b.CancelToken = yr;
|
|
1686
1686
|
b.isCancel = wt;
|
|
1687
1687
|
b.VERSION = Ot;
|
|
1688
|
-
b.toFormData =
|
|
1688
|
+
b.toFormData = ie;
|
|
1689
1689
|
b.AxiosError = y;
|
|
1690
1690
|
b.Cancel = b.CanceledError;
|
|
1691
1691
|
b.all = function(t) {
|
|
@@ -1852,7 +1852,7 @@ function Cr(e = kr, t = {}) {
|
|
|
1852
1852
|
events: o = xr,
|
|
1853
1853
|
window: s = kt,
|
|
1854
1854
|
eventFilter: i = Tr(50)
|
|
1855
|
-
} = t, c =
|
|
1855
|
+
} = t, c = Y(n), f = Y(Je());
|
|
1856
1856
|
let l;
|
|
1857
1857
|
const u = Rr(i, () => {
|
|
1858
1858
|
c.value = !1, f.value = Je(), clearTimeout(l), l = setTimeout(() => c.value = !0, e);
|
|
@@ -1933,14 +1933,14 @@ let Pt = (e = 21) => {
|
|
|
1933
1933
|
}
|
|
1934
1934
|
return t;
|
|
1935
1935
|
};
|
|
1936
|
-
const
|
|
1936
|
+
const he = (e) => new URL(location.href).searchParams.get(e), D = {
|
|
1937
1937
|
oauth: "/api/justauth/oauth-server/v1/visitor/oauth/authorize",
|
|
1938
1938
|
// 重定向到登录页
|
|
1939
1939
|
logoutCurpage: "/api/justauth/oauth-server/v1/visitor/logout-curpage",
|
|
1940
1940
|
// 清除登录信息
|
|
1941
1941
|
token: "/api/justauth/oauth-server/v1/visitor/oauth/token"
|
|
1942
1942
|
// 通过code获取token
|
|
1943
|
-
}, { baseURL: Ze, noRedireLogin: Ir = !1 } = Ae(),
|
|
1943
|
+
}, { baseURL: Ze, noRedireLogin: Ir = !1 } = Ae(), ne = location.origin + "/home", q = {
|
|
1944
1944
|
response_type: "code",
|
|
1945
1945
|
scope: "sever",
|
|
1946
1946
|
client_id: "sys",
|
|
@@ -1951,7 +1951,7 @@ const X = (e) => new URL(location.href).searchParams.get(e), D = {
|
|
|
1951
1951
|
e.forEach((r) => {
|
|
1952
1952
|
n.delete(r);
|
|
1953
1953
|
}), t.search = n.toString(), window.history.replaceState({}, "", t);
|
|
1954
|
-
}, Ut =
|
|
1954
|
+
}, Ut = Y(!1), Lt = (e) => {
|
|
1955
1955
|
if (e <= 0) return;
|
|
1956
1956
|
const { idle: t } = Cr(e);
|
|
1957
1957
|
Oe(
|
|
@@ -1964,56 +1964,55 @@ const X = (e) => new URL(location.href).searchParams.get(e), D = {
|
|
|
1964
1964
|
localStorage.getItem("idelTime") && Lt(Number(localStorage.getItem("idelTime")));
|
|
1965
1965
|
let et = "";
|
|
1966
1966
|
const Br = async () => {
|
|
1967
|
-
const e =
|
|
1967
|
+
const e = he("code") || "", t = he("redirect_url") || "/", n = he("kingdee_token") || "";
|
|
1968
1968
|
if (!e) return M();
|
|
1969
|
-
|
|
1970
|
-
if (r && localStorage.setItem("loginType", r), e === et)
|
|
1969
|
+
if (e === et)
|
|
1971
1970
|
return Ye(["code", "state", "kingdee_token", "redirect_url"]), window.__isAutoCloseApp = !1, window.location.replace(decodeURIComponent(t)), M();
|
|
1972
|
-
et = e, Ye(["code", "state", "kingdee_token", "redirect_url"
|
|
1973
|
-
let
|
|
1974
|
-
const
|
|
1971
|
+
et = e, Ye(["code", "state", "kingdee_token", "redirect_url"]);
|
|
1972
|
+
let r = {};
|
|
1973
|
+
const o = {
|
|
1975
1974
|
grant_type: "authorization_code",
|
|
1976
1975
|
code: e,
|
|
1977
1976
|
client_id: q.client_id,
|
|
1978
1977
|
client_secret: q.client_secret,
|
|
1979
|
-
redirect_uri:
|
|
1978
|
+
redirect_uri: ne,
|
|
1980
1979
|
timestamp: (/* @__PURE__ */ new Date()).getTime(),
|
|
1981
1980
|
nonce: Pt()
|
|
1982
1981
|
};
|
|
1983
|
-
n && (sessionStorage.setItem("kingdee_token", n),
|
|
1982
|
+
n && (sessionStorage.setItem("kingdee_token", n), o.redirect_uri = `${o.redirect_uri}?kingdee_token=${n}`);
|
|
1984
1983
|
try {
|
|
1985
1984
|
await b.create().get(D.token, { baseURL: Ze });
|
|
1986
1985
|
} catch {
|
|
1987
1986
|
}
|
|
1988
1987
|
try {
|
|
1989
|
-
|
|
1988
|
+
r = await b.create().post(
|
|
1990
1989
|
D.token,
|
|
1991
1990
|
{},
|
|
1992
1991
|
{
|
|
1993
1992
|
baseURL: Ze,
|
|
1994
|
-
params:
|
|
1993
|
+
params: o,
|
|
1995
1994
|
headers: {
|
|
1996
1995
|
"Content-Type": "application/x-www-form-urlencoded",
|
|
1997
1996
|
"csrf-token": Er.get("csrf-token")
|
|
1998
1997
|
}
|
|
1999
1998
|
}
|
|
2000
1999
|
);
|
|
2001
|
-
const { access_token:
|
|
2002
|
-
accessToken:
|
|
2003
|
-
accessTokenExpiredAt: +/* @__PURE__ */ new Date() + Number(
|
|
2004
|
-
refreshToken:
|
|
2005
|
-
info:
|
|
2000
|
+
const { access_token: s = "", expires_in: i = 0, refresh_token: c = "", refresh_exp: f = 0 } = r.data, l = {
|
|
2001
|
+
accessToken: s,
|
|
2002
|
+
accessTokenExpiredAt: +/* @__PURE__ */ new Date() + Number(i) * 1e3,
|
|
2003
|
+
refreshToken: c,
|
|
2004
|
+
info: r.data
|
|
2006
2005
|
};
|
|
2007
|
-
$().save(
|
|
2008
|
-
const
|
|
2009
|
-
return
|
|
2006
|
+
$().save(l), await tt(s);
|
|
2007
|
+
const u = Number(f) - (/* @__PURE__ */ new Date()).getTime();
|
|
2008
|
+
return u && u > 0 && (Lt(u), u && localStorage.setItem("idelTime", u.toString())), t && (window.__isAutoCloseApp = !1, window.location.replace(decodeURIComponent(t))), s;
|
|
2010
2009
|
} catch {
|
|
2011
|
-
return
|
|
2010
|
+
return ue({ ...q, redirect_uri: ne });
|
|
2012
2011
|
}
|
|
2013
|
-
}, j =
|
|
2012
|
+
}, j = Y(!1), ho = async (e) => {
|
|
2014
2013
|
if (e.public) return "";
|
|
2015
2014
|
if (Ut.value)
|
|
2016
|
-
return
|
|
2015
|
+
return ue({ ...q, redirect_uri: ne });
|
|
2017
2016
|
if (j.value)
|
|
2018
2017
|
return await new Promise(async (r) => {
|
|
2019
2018
|
Oe(
|
|
@@ -2043,7 +2042,7 @@ const Br = async () => {
|
|
|
2043
2042
|
const r = `https://iam.shenyejituan.com:443/idp/profile/OAUTH2/Redirect/GLO?redirctToUrl=${encodeURIComponent(e)}&entityId=AIoT&redirectToLogin=true`;
|
|
2044
2043
|
localStorage.removeItem("thirdLogouSource"), location.href = r;
|
|
2045
2044
|
}
|
|
2046
|
-
},
|
|
2045
|
+
}, ue = (e) => {
|
|
2047
2046
|
if (Ir) return;
|
|
2048
2047
|
const t = { ...e }, n = localStorage.getItem("loginType") || "";
|
|
2049
2048
|
n && (t.redirect_uri = jt(t.redirect_uri, { loginType: n }));
|
|
@@ -2051,7 +2050,7 @@ const Br = async () => {
|
|
|
2051
2050
|
if (Te) return Te(t);
|
|
2052
2051
|
t.logout = "true", o && (t.locale = "locale");
|
|
2053
2052
|
const s = Object.keys(t).filter((c) => c !== "client_secret").map((c) => `${c}=${t[c]}`).join("&"), i = `${r}${D.oauth}?${s}`;
|
|
2054
|
-
if (localStorage.removeItem("idelTime"),
|
|
2053
|
+
if (localStorage.removeItem("idelTime"), sessionStorage.clear(), $().remove(), jr())
|
|
2055
2054
|
qr(i);
|
|
2056
2055
|
else {
|
|
2057
2056
|
try {
|
|
@@ -2061,7 +2060,7 @@ const Br = async () => {
|
|
|
2061
2060
|
window.__isAutoCloseApp = !1, location.replace(i);
|
|
2062
2061
|
}
|
|
2063
2062
|
};
|
|
2064
|
-
vr(
|
|
2063
|
+
vr(ue);
|
|
2065
2064
|
const Mr = async (e) => {
|
|
2066
2065
|
const { baseURL: t } = Ae(), { refreshToken: n } = $().getData();
|
|
2067
2066
|
try {
|
|
@@ -2091,13 +2090,13 @@ const Mr = async (e) => {
|
|
|
2091
2090
|
};
|
|
2092
2091
|
return $().save(c), await tt(o), o;
|
|
2093
2092
|
} catch {
|
|
2094
|
-
return
|
|
2093
|
+
return ue({ ...e, redirect_uri: ne });
|
|
2095
2094
|
}
|
|
2096
2095
|
}, $ = () => ({
|
|
2097
2096
|
getData: () => ({
|
|
2098
2097
|
accessToken: M(),
|
|
2099
|
-
accessTokenExpiredAt:
|
|
2100
|
-
refreshToken:
|
|
2098
|
+
accessTokenExpiredAt: le("accessTokenExpiredAt") ? Number(le("accessTokenExpiredAt")) : "",
|
|
2099
|
+
refreshToken: le("refreshToken")
|
|
2101
2100
|
}),
|
|
2102
2101
|
save: (e) => {
|
|
2103
2102
|
Bt(e.accessToken ?? "", {
|
|
@@ -2110,11 +2109,11 @@ const Mr = async (e) => {
|
|
|
2110
2109
|
}
|
|
2111
2110
|
});
|
|
2112
2111
|
export {
|
|
2113
|
-
|
|
2112
|
+
he as getQuery,
|
|
2114
2113
|
ho as getToken,
|
|
2115
2114
|
Br as getTokenFromCode,
|
|
2116
2115
|
q as getTokenParams,
|
|
2117
|
-
|
|
2118
|
-
|
|
2116
|
+
ue as login,
|
|
2117
|
+
ne as real_uri,
|
|
2119
2118
|
$ as tokenStorage
|
|
2120
2119
|
};
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/utils",
|
|
3
|
-
"version": "7.0.7-hot.
|
|
3
|
+
"version": "7.0.7-hot.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@antv/x6": "^2.18.1",
|
|
12
|
-
"@das-fed/utils": "7.0.7-hot.
|
|
12
|
+
"@das-fed/utils": "7.0.7-hot.8",
|
|
13
13
|
"@vue/shared": "^3.4.21",
|
|
14
14
|
"@vueuse/core": "^9.6.0",
|
|
15
15
|
"axios": "^1.6.7",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"vue": "^3.4.21"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@das-fed/cli": "7.0.7-hot.
|
|
25
|
-
"@das-fed/web": "7.0.7-hot.
|
|
24
|
+
"@das-fed/cli": "7.0.7-hot.8",
|
|
25
|
+
"@das-fed/web": "7.0.7-hot.8",
|
|
26
26
|
"@types/js-cookie": "^3.0.6",
|
|
27
27
|
"@types/lodash-es": "^4.17.12",
|
|
28
28
|
"@types/qs": "^6.9.15",
|