@das-fed/utils 7.0.1-beta.4 → 7.0.1-beta.5
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/index.js +864 -882
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +717 -735
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +717 -735
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.js +841 -855
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +717 -735
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +708 -712
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +719 -733
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +628 -624
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +735 -721
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +717 -735
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.js +626 -622
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +716 -734
- package/api-services/src/create-service/index.js.gz +0 -0
- package/create-api-service/sso/index.js +119 -108
- 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 Ut, getCurrentScope as Dt, onScopeDispose as
|
|
2
|
-
import { encryption as
|
|
1
|
+
import { unref as Ut, getCurrentScope as Dt, onScopeDispose as vt, ref as ee, watch as Te } from "vue";
|
|
2
|
+
import { encryption as Ft } from "@das-fed/utils/atob";
|
|
3
3
|
import { getConfig as Oe } from "@das-fed/utils/config";
|
|
4
|
-
import { getAccessToken as
|
|
4
|
+
import { getAccessToken as v, removeAccessToken as It, setAccessToken as Bt, getAccessTokenInfo as ue } from "@das-fed/utils/token-tools";
|
|
5
5
|
import { removeProcessEngineToken as jt, setProcessEngineToken as qt } from "@das-fed/utils/process-engine-info";
|
|
6
6
|
import { setPersonalInfo as tt } from "@das-fed/utils/common-info/set-personal-info";
|
|
7
7
|
function nt(e, t) {
|
|
@@ -12,7 +12,7 @@ function nt(e, t) {
|
|
|
12
12
|
const { toString: Ht } = Object.prototype, { getPrototypeOf: Ae } = Object, re = /* @__PURE__ */ ((e) => (t) => {
|
|
13
13
|
const n = Ht.call(t);
|
|
14
14
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
15
|
-
})(/* @__PURE__ */ Object.create(null)), x = (e) => (e = e.toLowerCase(), (t) => re(t) === e), oe = (e) => (t) => typeof t === e, { isArray:
|
|
15
|
+
})(/* @__PURE__ */ Object.create(null)), x = (e) => (e = e.toLowerCase(), (t) => re(t) === e), oe = (e) => (t) => typeof t === e, { isArray: B } = Array, M = oe("undefined");
|
|
16
16
|
function Mt(e) {
|
|
17
17
|
return e !== null && !M(e) && e.constructor !== null && !M(e.constructor) && _(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
18
18
|
}
|
|
@@ -35,7 +35,7 @@ function V(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
35
35
|
if (e === null || typeof e > "u")
|
|
36
36
|
return;
|
|
37
37
|
let r, o;
|
|
38
|
-
if (typeof e != "object" && (e = [e]),
|
|
38
|
+
if (typeof e != "object" && (e = [e]), B(e))
|
|
39
39
|
for (r = 0, o = e.length; r < o; r++)
|
|
40
40
|
t.call(null, e[r], r, e);
|
|
41
41
|
else {
|
|
@@ -54,11 +54,11 @@ function st(e, t) {
|
|
|
54
54
|
return o;
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
|
-
const
|
|
57
|
+
const N = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, it = (e) => !M(e) && e !== N;
|
|
58
58
|
function he() {
|
|
59
59
|
const { caseless: e } = it(this) && this || {}, t = {}, n = (r, o) => {
|
|
60
60
|
const s = e && st(t, o) || o;
|
|
61
|
-
G(t[s]) && G(r) ? t[s] = he(t[s], r) : G(r) ? t[s] = he({}, r) :
|
|
61
|
+
G(t[s]) && G(r) ? t[s] = he(t[s], r) : G(r) ? t[s] = he({}, r) : B(r) ? t[s] = r.slice() : t[s] = r;
|
|
62
62
|
};
|
|
63
63
|
for (let r = 0, o = arguments.length; r < o; r++)
|
|
64
64
|
arguments[r] && V(arguments[r], n);
|
|
@@ -86,7 +86,7 @@ const on = (e, t, n, { allOwnKeys: r } = {}) => (V(t, (o, s) => {
|
|
|
86
86
|
return r !== -1 && r === n;
|
|
87
87
|
}, ln = (e) => {
|
|
88
88
|
if (!e) return null;
|
|
89
|
-
if (
|
|
89
|
+
if (B(e)) return e;
|
|
90
90
|
let t = e.length;
|
|
91
91
|
if (!ot(t)) return null;
|
|
92
92
|
const n = new Array(t);
|
|
@@ -138,12 +138,12 @@ const on = (e, t, n, { allOwnKeys: r } = {}) => (V(t, (o, s) => {
|
|
|
138
138
|
n[s] = !0;
|
|
139
139
|
});
|
|
140
140
|
};
|
|
141
|
-
return
|
|
141
|
+
return B(e) ? r(e) : r(String(e).split(t)), n;
|
|
142
142
|
}, bn = () => {
|
|
143
|
-
}, En = (e, t) => e != null && Number.isFinite(e = +e) ? e : t, le = "abcdefghijklmnopqrstuvwxyz",
|
|
144
|
-
DIGIT:
|
|
143
|
+
}, En = (e, t) => e != null && Number.isFinite(e = +e) ? e : t, le = "abcdefghijklmnopqrstuvwxyz", Le = "0123456789", ct = {
|
|
144
|
+
DIGIT: Le,
|
|
145
145
|
ALPHA: le,
|
|
146
|
-
ALPHA_DIGIT: le + le.toUpperCase() +
|
|
146
|
+
ALPHA_DIGIT: le + le.toUpperCase() + Le
|
|
147
147
|
}, Sn = (e = 16, t = ct.ALPHA_DIGIT) => {
|
|
148
148
|
let n = "";
|
|
149
149
|
const { length: r } = t;
|
|
@@ -161,7 +161,7 @@ const Tn = (e) => {
|
|
|
161
161
|
return;
|
|
162
162
|
if (!("toJSON" in r)) {
|
|
163
163
|
t[o] = r;
|
|
164
|
-
const s =
|
|
164
|
+
const s = B(r) ? [] : {};
|
|
165
165
|
return V(r, (i, c) => {
|
|
166
166
|
const f = n(i, o + 1);
|
|
167
167
|
!M(f) && (s[c] = f);
|
|
@@ -171,15 +171,15 @@ const Tn = (e) => {
|
|
|
171
171
|
return r;
|
|
172
172
|
};
|
|
173
173
|
return n(e, 0);
|
|
174
|
-
}, On = x("AsyncFunction"), An = (e) => e && (se(e) || _(e)) && _(e.then) && _(e.catch), ut = ((e, t) => e ? setImmediate : t ? ((n, r) => (
|
|
175
|
-
o ===
|
|
174
|
+
}, On = x("AsyncFunction"), An = (e) => e && (se(e) || _(e)) && _(e.then) && _(e.catch), ut = ((e, t) => e ? setImmediate : t ? ((n, r) => (N.addEventListener("message", ({ source: o, data: s }) => {
|
|
175
|
+
o === N && s === n && r.length && r.shift()();
|
|
176
176
|
}, !1), (o) => {
|
|
177
|
-
r.push(o),
|
|
177
|
+
r.push(o), N.postMessage(n, "*");
|
|
178
178
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
179
179
|
typeof setImmediate == "function",
|
|
180
|
-
_(
|
|
181
|
-
), _n = typeof queueMicrotask < "u" ? queueMicrotask.bind(
|
|
182
|
-
isArray:
|
|
180
|
+
_(N.postMessage)
|
|
181
|
+
), _n = typeof queueMicrotask < "u" ? queueMicrotask.bind(N) : typeof process < "u" && process.nextTick || ut, a = {
|
|
182
|
+
isArray: B,
|
|
183
183
|
isArrayBuffer: rt,
|
|
184
184
|
isBuffer: Mt,
|
|
185
185
|
isFormData: Xt,
|
|
@@ -227,7 +227,7 @@ const Tn = (e) => {
|
|
|
227
227
|
noop: bn,
|
|
228
228
|
toFiniteNumber: En,
|
|
229
229
|
findKey: st,
|
|
230
|
-
global:
|
|
230
|
+
global: N,
|
|
231
231
|
isContextDefined: it,
|
|
232
232
|
ALPHABET: ct,
|
|
233
233
|
generateString: Sn,
|
|
@@ -295,7 +295,7 @@ function me(e) {
|
|
|
295
295
|
function dt(e) {
|
|
296
296
|
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function Ne(e, t, n) {
|
|
299
299
|
return e ? e.concat(t).map(function(o, s) {
|
|
300
300
|
return o = dt(o), !n && s ? "[" + o + "]" : o;
|
|
301
301
|
}).join(n ? "." : "") : t;
|
|
@@ -336,12 +336,12 @@ function ie(e, t, n) {
|
|
|
336
336
|
return m = dt(m), E.forEach(function(R, k) {
|
|
337
337
|
!(a.isUndefined(R) || R === null) && t.append(
|
|
338
338
|
// eslint-disable-next-line no-nested-ternary
|
|
339
|
-
i === !0 ?
|
|
339
|
+
i === !0 ? Ne([m], k, s) : i === null ? m : m + "[]",
|
|
340
340
|
l(R)
|
|
341
341
|
);
|
|
342
342
|
}), !1;
|
|
343
343
|
}
|
|
344
|
-
return me(p) ? !0 : (t.append(
|
|
344
|
+
return me(p) ? !0 : (t.append(Ne(h, m, s), l(p)), !1);
|
|
345
345
|
}
|
|
346
346
|
const d = [], w = Object.assign(kn, {
|
|
347
347
|
defaultVisitor: u,
|
|
@@ -472,24 +472,24 @@ const mt = {
|
|
|
472
472
|
silentJSONParsing: !0,
|
|
473
473
|
forcedJSONParsing: !0,
|
|
474
474
|
clarifyTimeoutError: !1
|
|
475
|
-
},
|
|
475
|
+
}, Ln = typeof URLSearchParams < "u" ? URLSearchParams : _e, Nn = typeof FormData < "u" ? FormData : null, Un = typeof Blob < "u" ? Blob : null, Dn = {
|
|
476
476
|
isBrowser: !0,
|
|
477
477
|
classes: {
|
|
478
|
-
URLSearchParams:
|
|
479
|
-
FormData:
|
|
478
|
+
URLSearchParams: Ln,
|
|
479
|
+
FormData: Nn,
|
|
480
480
|
Blob: Un
|
|
481
481
|
},
|
|
482
482
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
483
|
-
}, xe = typeof window < "u" && typeof document < "u", ye = typeof navigator == "object" && navigator || void 0,
|
|
484
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function",
|
|
483
|
+
}, xe = typeof window < "u" && typeof document < "u", ye = typeof navigator == "object" && navigator || void 0, vn = xe && (!ye || ["ReactNative", "NativeScript", "NS"].indexOf(ye.product) < 0), Fn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
484
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", In = xe && window.location.href || "http://localhost", Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
485
485
|
__proto__: null,
|
|
486
486
|
hasBrowserEnv: xe,
|
|
487
|
-
hasStandardBrowserEnv:
|
|
488
|
-
hasStandardBrowserWebWorkerEnv:
|
|
487
|
+
hasStandardBrowserEnv: vn,
|
|
488
|
+
hasStandardBrowserWebWorkerEnv: Fn,
|
|
489
489
|
navigator: ye,
|
|
490
|
-
origin:
|
|
490
|
+
origin: In
|
|
491
491
|
}, Symbol.toStringTag, { value: "Module" })), T = {
|
|
492
|
-
...
|
|
492
|
+
...Bn,
|
|
493
493
|
...Dn
|
|
494
494
|
};
|
|
495
495
|
function jn(e, t) {
|
|
@@ -630,7 +630,7 @@ const $n = a.toObjectSet([
|
|
|
630
630
|
`).forEach(function(i) {
|
|
631
631
|
o = i.indexOf(":"), n = i.substring(0, o).trim().toLowerCase(), r = i.substring(o + 1).trim(), !(!n || t[n] && $n[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
632
632
|
}), t;
|
|
633
|
-
},
|
|
633
|
+
}, ve = Symbol("internals");
|
|
634
634
|
function q(e) {
|
|
635
635
|
return e && String(e).trim().toLowerCase();
|
|
636
636
|
}
|
|
@@ -777,7 +777,7 @@ let A = class {
|
|
|
777
777
|
return n.forEach((o) => r.set(o)), r;
|
|
778
778
|
}
|
|
779
779
|
static accessor(t) {
|
|
780
|
-
const r = (this[
|
|
780
|
+
const r = (this[ve] = this[ve] = {
|
|
781
781
|
accessors: {}
|
|
782
782
|
}).accessors, o = this.prototype;
|
|
783
783
|
function s(i) {
|
|
@@ -875,14 +875,14 @@ const te = (e, t, n = 3) => {
|
|
|
875
875
|
};
|
|
876
876
|
e(d);
|
|
877
877
|
}, n);
|
|
878
|
-
},
|
|
878
|
+
}, Fe = (e, t) => {
|
|
879
879
|
const n = e != null;
|
|
880
880
|
return [(r) => t[0]({
|
|
881
881
|
lengthComputable: n,
|
|
882
882
|
total: e,
|
|
883
883
|
loaded: r
|
|
884
884
|
}), t[1]];
|
|
885
|
-
},
|
|
885
|
+
}, Ie = (e) => (...t) => a.asap(() => e(...t)), Zn = T.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, T.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
886
886
|
new URL(T.origin),
|
|
887
887
|
T.navigator && /(msie|trident)/i.test(T.navigator.userAgent)
|
|
888
888
|
) : () => !0, Yn = T.hasStandardBrowserEnv ? (
|
|
@@ -921,7 +921,7 @@ function tr(e, t) {
|
|
|
921
921
|
function bt(e, t) {
|
|
922
922
|
return e && !er(t) ? tr(e, t) : t;
|
|
923
923
|
}
|
|
924
|
-
const
|
|
924
|
+
const Be = (e) => e instanceof A ? { ...e } : e;
|
|
925
925
|
function D(e, t) {
|
|
926
926
|
t = t || {};
|
|
927
927
|
const n = {};
|
|
@@ -979,7 +979,7 @@ function D(e, t) {
|
|
|
979
979
|
socketPath: i,
|
|
980
980
|
responseEncoding: i,
|
|
981
981
|
validateStatus: c,
|
|
982
|
-
headers: (l, u, d) => o(
|
|
982
|
+
headers: (l, u, d) => o(Be(l), Be(u), d, !0)
|
|
983
983
|
};
|
|
984
984
|
return a.forEach(Object.keys(Object.assign({}, e, t)), function(u) {
|
|
985
985
|
const d = f[u] || o, w = d(e[u], t[u], u);
|
|
@@ -1031,10 +1031,10 @@ const Et = (e) => {
|
|
|
1031
1031
|
config: e,
|
|
1032
1032
|
request: h
|
|
1033
1033
|
};
|
|
1034
|
-
gt(function(
|
|
1035
|
-
n(
|
|
1036
|
-
}, function(
|
|
1037
|
-
r(
|
|
1034
|
+
gt(function(L) {
|
|
1035
|
+
n(L), m();
|
|
1036
|
+
}, function(L) {
|
|
1037
|
+
r(L), m();
|
|
1038
1038
|
}, O), h = null;
|
|
1039
1039
|
}
|
|
1040
1040
|
"onloadend" in h ? h.onloadend = E : h.onreadystatechange = function() {
|
|
@@ -1216,11 +1216,11 @@ const lr = async (e) => {
|
|
|
1216
1216
|
duplex: "half"
|
|
1217
1217
|
}), P;
|
|
1218
1218
|
if (a.isFormData(r) && (P = O.headers.get("content-type")) && u.setContentType(P), O.body) {
|
|
1219
|
-
const [
|
|
1219
|
+
const [L, K] = Fe(
|
|
1220
1220
|
h,
|
|
1221
|
-
te(
|
|
1221
|
+
te(Ie(f))
|
|
1222
1222
|
);
|
|
1223
|
-
r = je(O.body, qe,
|
|
1223
|
+
r = je(O.body, qe, L, K);
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
1226
|
a.isString(d) || (d = d ? "include" : "omit");
|
|
@@ -1241,12 +1241,12 @@ const lr = async (e) => {
|
|
|
1241
1241
|
["status", "statusText", "headers"].forEach((ke) => {
|
|
1242
1242
|
O[ke] = S[ke];
|
|
1243
1243
|
});
|
|
1244
|
-
const P = a.toFiniteNumber(S.headers.get("content-length")), [
|
|
1244
|
+
const P = a.toFiniteNumber(S.headers.get("content-length")), [L, K] = c && Fe(
|
|
1245
1245
|
P,
|
|
1246
|
-
te(
|
|
1246
|
+
te(Ie(c), !0)
|
|
1247
1247
|
) || [];
|
|
1248
1248
|
S = new Response(
|
|
1249
|
-
je(S.body, qe,
|
|
1249
|
+
je(S.body, qe, L, () => {
|
|
1250
1250
|
K && K(), m && m();
|
|
1251
1251
|
}),
|
|
1252
1252
|
O
|
|
@@ -1683,22 +1683,22 @@ b.getAdapter = Tt.getAdapter;
|
|
|
1683
1683
|
b.HttpStatusCode = be;
|
|
1684
1684
|
b.default = b;
|
|
1685
1685
|
const {
|
|
1686
|
-
Axios:
|
|
1687
|
-
AxiosError:
|
|
1688
|
-
CanceledError:
|
|
1689
|
-
isCancel:
|
|
1690
|
-
CancelToken:
|
|
1691
|
-
VERSION:
|
|
1692
|
-
all:
|
|
1693
|
-
Cancel:
|
|
1694
|
-
isAxiosError:
|
|
1695
|
-
spread:
|
|
1696
|
-
toFormData:
|
|
1697
|
-
AxiosHeaders:
|
|
1698
|
-
HttpStatusCode:
|
|
1699
|
-
formToJSON:
|
|
1700
|
-
getAdapter:
|
|
1701
|
-
mergeConfig:
|
|
1686
|
+
Axios: Qr,
|
|
1687
|
+
AxiosError: Gr,
|
|
1688
|
+
CanceledError: Xr,
|
|
1689
|
+
isCancel: Zr,
|
|
1690
|
+
CancelToken: Yr,
|
|
1691
|
+
VERSION: eo,
|
|
1692
|
+
all: to,
|
|
1693
|
+
Cancel: no,
|
|
1694
|
+
isAxiosError: ro,
|
|
1695
|
+
spread: oo,
|
|
1696
|
+
toFormData: so,
|
|
1697
|
+
AxiosHeaders: io,
|
|
1698
|
+
HttpStatusCode: ao,
|
|
1699
|
+
formToJSON: co,
|
|
1700
|
+
getAdapter: uo,
|
|
1701
|
+
mergeConfig: lo
|
|
1702
1702
|
} = b;
|
|
1703
1703
|
/*! js-cookie v3.0.5 | MIT */
|
|
1704
1704
|
function Q(e) {
|
|
@@ -1803,7 +1803,7 @@ function Tr(e) {
|
|
|
1803
1803
|
return e;
|
|
1804
1804
|
}
|
|
1805
1805
|
function Or(e) {
|
|
1806
|
-
return Dt() ? (
|
|
1806
|
+
return Dt() ? (vt(e), !0) : !1;
|
|
1807
1807
|
}
|
|
1808
1808
|
function Ar(e) {
|
|
1809
1809
|
var t;
|
|
@@ -1854,12 +1854,12 @@ var Qe;
|
|
|
1854
1854
|
(function(e) {
|
|
1855
1855
|
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
|
|
1856
1856
|
})(Qe || (Qe = {}));
|
|
1857
|
-
var kr = Object.defineProperty, Ge = Object.getOwnPropertySymbols, Pr = Object.prototype.hasOwnProperty,
|
|
1857
|
+
var kr = Object.defineProperty, Ge = Object.getOwnPropertySymbols, Pr = Object.prototype.hasOwnProperty, Lr = Object.prototype.propertyIsEnumerable, Xe = (e, t, n) => t in e ? kr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Nr = (e, t) => {
|
|
1858
1858
|
for (var n in t || (t = {}))
|
|
1859
1859
|
Pr.call(t, n) && Xe(e, n, t[n]);
|
|
1860
1860
|
if (Ge)
|
|
1861
1861
|
for (var n of Ge(t))
|
|
1862
|
-
|
|
1862
|
+
Lr.call(t, n) && Xe(e, n, t[n]);
|
|
1863
1863
|
return e;
|
|
1864
1864
|
};
|
|
1865
1865
|
const Ur = {
|
|
@@ -1888,7 +1888,7 @@ const Ur = {
|
|
|
1888
1888
|
easeOutBack: [0.34, 1.56, 0.64, 1],
|
|
1889
1889
|
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
|
1890
1890
|
};
|
|
1891
|
-
|
|
1891
|
+
Nr({
|
|
1892
1892
|
linear: Tr
|
|
1893
1893
|
}, Ur);
|
|
1894
1894
|
let Re;
|
|
@@ -1901,7 +1901,7 @@ const kt = { triggerProxySso: "triggerProxySso" }, Dr = () => {
|
|
|
1901
1901
|
t
|
|
1902
1902
|
);
|
|
1903
1903
|
};
|
|
1904
|
-
},
|
|
1904
|
+
}, vr = (e) => {
|
|
1905
1905
|
window.top === window.self && window.addEventListener("message", (t) => {
|
|
1906
1906
|
const { type: n, data: r } = t.data;
|
|
1907
1907
|
n === kt.triggerProxySso && (e == null || e(r));
|
|
@@ -1916,60 +1916,60 @@ let Pt = (e = 21) => {
|
|
|
1916
1916
|
}
|
|
1917
1917
|
return t;
|
|
1918
1918
|
};
|
|
1919
|
-
const Y = (e) => new URL(location.href).searchParams.get(e),
|
|
1919
|
+
const Y = (e) => new URL(location.href).searchParams.get(e), I = {
|
|
1920
1920
|
oauth: "/api/justauth/oauth-server/v1/visitor/oauth/authorize",
|
|
1921
1921
|
// 重定向到登录页
|
|
1922
1922
|
logoutCurpage: "/api/justauth/oauth-server/v1/visitor/logout-curpage",
|
|
1923
1923
|
// 清除登录信息
|
|
1924
1924
|
token: "/api/justauth/oauth-server/v1/visitor/oauth/token"
|
|
1925
1925
|
// 通过code获取token
|
|
1926
|
-
}, { baseURL: Ze, noRedireLogin:
|
|
1926
|
+
}, { baseURL: Ze, noRedireLogin: Fr = !1 } = Oe(), $ = location.origin + "/home", F = {
|
|
1927
1927
|
response_type: "code",
|
|
1928
1928
|
scope: "sever",
|
|
1929
1929
|
client_id: "sys",
|
|
1930
|
-
client_secret:
|
|
1930
|
+
client_secret: Ft("das123"),
|
|
1931
1931
|
state: +/* @__PURE__ */ new Date()
|
|
1932
1932
|
}, Ye = (e) => {
|
|
1933
1933
|
const t = new URL(window.location.href), n = new URLSearchParams(t.search);
|
|
1934
1934
|
e.forEach((r) => {
|
|
1935
1935
|
n.delete(r);
|
|
1936
1936
|
}), t.search = n.toString(), window.history.replaceState({}, "", t);
|
|
1937
|
-
},
|
|
1937
|
+
}, Lt = ee(!1), Nt = (e) => {
|
|
1938
1938
|
if (e <= 0) return;
|
|
1939
1939
|
const { idle: t } = Cr(e);
|
|
1940
1940
|
Te(
|
|
1941
1941
|
() => t.value,
|
|
1942
1942
|
(n) => {
|
|
1943
|
-
n === !0 && (
|
|
1943
|
+
n === !0 && (Lt.value = !0);
|
|
1944
1944
|
}
|
|
1945
1945
|
);
|
|
1946
1946
|
};
|
|
1947
|
-
localStorage.getItem("idelTime") &&
|
|
1947
|
+
localStorage.getItem("idelTime") && Nt(Number(localStorage.getItem("idelTime")));
|
|
1948
1948
|
let et = "";
|
|
1949
|
-
const
|
|
1949
|
+
const Ir = async () => {
|
|
1950
1950
|
const e = Y("code") || "", t = Y("redirect_url") || "", n = Y("kingdee_token") || "";
|
|
1951
|
-
if (!e) return
|
|
1951
|
+
if (!e) return v();
|
|
1952
1952
|
if (e === et)
|
|
1953
|
-
return Ye(["code", "state", "kingdee_token", "redirect_url"]), t && (window.__isAutoCloseApp = !1, window.location.replace(decodeURIComponent(t))),
|
|
1953
|
+
return Ye(["code", "state", "kingdee_token", "redirect_url"]), t && (window.__isAutoCloseApp = !1, window.location.replace(decodeURIComponent(t))), v();
|
|
1954
1954
|
et = e, Ye(["code", "state", "kingdee_token", "redirect_url"]);
|
|
1955
1955
|
let r = {};
|
|
1956
1956
|
const o = {
|
|
1957
1957
|
grant_type: "authorization_code",
|
|
1958
1958
|
code: e,
|
|
1959
|
-
client_id:
|
|
1960
|
-
client_secret:
|
|
1959
|
+
client_id: F.client_id,
|
|
1960
|
+
client_secret: F.client_secret,
|
|
1961
1961
|
redirect_uri: $,
|
|
1962
1962
|
timestamp: (/* @__PURE__ */ new Date()).getTime(),
|
|
1963
1963
|
nonce: Pt()
|
|
1964
1964
|
};
|
|
1965
1965
|
n && (sessionStorage.setItem("kingdee_token", n), o.redirect_uri = `${o.redirect_uri}?kingdee_token=${n}`);
|
|
1966
1966
|
try {
|
|
1967
|
-
await b.create().get(
|
|
1967
|
+
await b.create().get(I.token, { baseURL: Ze });
|
|
1968
1968
|
} catch {
|
|
1969
1969
|
}
|
|
1970
1970
|
try {
|
|
1971
1971
|
r = await b.create().post(
|
|
1972
|
-
|
|
1972
|
+
I.token,
|
|
1973
1973
|
{},
|
|
1974
1974
|
{
|
|
1975
1975
|
baseURL: Ze,
|
|
@@ -1988,59 +1988,70 @@ const Br = async () => {
|
|
|
1988
1988
|
};
|
|
1989
1989
|
J().save(l), await tt(s);
|
|
1990
1990
|
const u = Number(f) - (/* @__PURE__ */ new Date()).getTime();
|
|
1991
|
-
return u && u > 0 && (
|
|
1991
|
+
return u && u > 0 && (Nt(u), u && localStorage.setItem("idelTime", u.toString())), t && (window.__isAutoCloseApp = !1, window.location.replace(decodeURIComponent(t))), s;
|
|
1992
1992
|
} catch {
|
|
1993
|
-
return z({ ...
|
|
1993
|
+
return z({ ...F, redirect_uri: $ });
|
|
1994
1994
|
}
|
|
1995
|
-
}, H = ee(!1),
|
|
1995
|
+
}, H = ee(!1), fo = async (e) => {
|
|
1996
1996
|
if (e.public) return "";
|
|
1997
|
-
if (
|
|
1997
|
+
if (Lt.value) return z({ ...F, redirect_uri: $ });
|
|
1998
1998
|
if (H.value)
|
|
1999
1999
|
return await new Promise(async (o) => {
|
|
2000
2000
|
Te(
|
|
2001
2001
|
() => H.value,
|
|
2002
2002
|
(s) => {
|
|
2003
2003
|
if (!s) {
|
|
2004
|
-
const i =
|
|
2004
|
+
const i = v();
|
|
2005
2005
|
o(i);
|
|
2006
2006
|
}
|
|
2007
2007
|
}
|
|
2008
2008
|
);
|
|
2009
2009
|
});
|
|
2010
2010
|
const { accessTokenExpiredAt: t } = J().getData(), n = Y("code") || "";
|
|
2011
|
-
if ((!
|
|
2012
|
-
return z({ ...
|
|
2013
|
-
let r =
|
|
2011
|
+
if ((!v() || t === 0) && !n)
|
|
2012
|
+
return z({ ...F, redirect_uri: $ });
|
|
2013
|
+
let r = v();
|
|
2014
2014
|
H.value = !0;
|
|
2015
2015
|
try {
|
|
2016
|
-
typeof t == "number" && t > 0 && +/* @__PURE__ */ new Date() + 6e4 > t && (r = await
|
|
2016
|
+
typeof t == "number" && t > 0 && +/* @__PURE__ */ new Date() + 6e4 > t && (r = await qr(F)), r = await Ir(), H.value = !1;
|
|
2017
2017
|
} catch {
|
|
2018
2018
|
H.value = !1;
|
|
2019
2019
|
}
|
|
2020
2020
|
return r;
|
|
2021
|
+
}, Br = () => {
|
|
2022
|
+
let e = !1;
|
|
2023
|
+
return localStorage.getItem("thirdLogouSource") === "zhongshen" && (e = !0), e;
|
|
2024
|
+
}, jr = (e) => {
|
|
2025
|
+
if (localStorage.getItem("thirdLogouSource") === "zhongshen") {
|
|
2026
|
+
const r = `https://iam.shenyejituan.com:6443/idp/profile/OAUTH2/Redirect/GLO?redirctToUrl=${encodeURIComponent(e)}&entityId=AIoT&redirectToLogin=true`;
|
|
2027
|
+
localStorage.removeItem("thirdLogouSource"), location.href = r;
|
|
2028
|
+
}
|
|
2021
2029
|
}, z = (e) => {
|
|
2022
|
-
if (
|
|
2030
|
+
if (Fr) return;
|
|
2023
2031
|
const { baseURL: t, ssoLocale: n } = Oe();
|
|
2024
2032
|
if (Re) return Re(e);
|
|
2025
2033
|
e.logout = "true", n && (e.locale = "locale");
|
|
2026
|
-
const r = Object.keys(e).filter((s) => s !== "client_secret").map((s) => `${s}=${e[s]}`).join("&"), o = `${t}${
|
|
2027
|
-
localStorage.removeItem("idelTime"), sessionStorage.clear(), J().remove()
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2034
|
+
const r = Object.keys(e).filter((s) => s !== "client_secret").map((s) => `${s}=${e[s]}`).join("&"), o = `${t}${I.oauth}?${r}`;
|
|
2035
|
+
if (localStorage.removeItem("idelTime"), sessionStorage.clear(), J().remove(), Br())
|
|
2036
|
+
jr(o);
|
|
2037
|
+
else {
|
|
2038
|
+
try {
|
|
2039
|
+
b.create().get(I.logoutCurpage, { baseURL: t });
|
|
2040
|
+
} catch {
|
|
2041
|
+
}
|
|
2042
|
+
window.__isAutoCloseApp = !1, location.replace(o);
|
|
2031
2043
|
}
|
|
2032
|
-
window.__isAutoCloseApp = !1, location.replace(o);
|
|
2033
2044
|
};
|
|
2034
|
-
|
|
2035
|
-
const
|
|
2045
|
+
vr(z);
|
|
2046
|
+
const qr = async (e) => {
|
|
2036
2047
|
const { baseURL: t } = Oe(), { refreshToken: n } = J().getData();
|
|
2037
2048
|
try {
|
|
2038
|
-
await b.create().get(
|
|
2049
|
+
await b.create().get(I.token, { baseURL: t });
|
|
2039
2050
|
} catch {
|
|
2040
2051
|
}
|
|
2041
2052
|
try {
|
|
2042
2053
|
const r = await b.create().post(
|
|
2043
|
-
|
|
2054
|
+
I.token,
|
|
2044
2055
|
{},
|
|
2045
2056
|
{
|
|
2046
2057
|
baseURL: t,
|
|
@@ -2065,12 +2076,12 @@ const Ir = async (e) => {
|
|
|
2065
2076
|
}
|
|
2066
2077
|
}, J = () => ({
|
|
2067
2078
|
getData: () => ({
|
|
2068
|
-
accessToken:
|
|
2079
|
+
accessToken: v(),
|
|
2069
2080
|
accessTokenExpiredAt: ue("accessTokenExpiredAt") ? Number(ue("accessTokenExpiredAt")) : "",
|
|
2070
2081
|
refreshToken: ue("refreshToken")
|
|
2071
2082
|
}),
|
|
2072
2083
|
save: (e) => {
|
|
2073
|
-
|
|
2084
|
+
Bt(
|
|
2074
2085
|
e.accessToken || "",
|
|
2075
2086
|
{
|
|
2076
2087
|
accessTokenExpiredAt: e.accessTokenExpiredAt,
|
|
@@ -2079,14 +2090,14 @@ const Ir = async (e) => {
|
|
|
2079
2090
|
), qt(e);
|
|
2080
2091
|
},
|
|
2081
2092
|
remove: () => {
|
|
2082
|
-
|
|
2093
|
+
It(), jt();
|
|
2083
2094
|
}
|
|
2084
2095
|
});
|
|
2085
2096
|
export {
|
|
2086
2097
|
Y as getQuery,
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2098
|
+
fo as getToken,
|
|
2099
|
+
Ir as getTokenFromCode,
|
|
2100
|
+
F as getTokenParams,
|
|
2090
2101
|
z as login,
|
|
2091
2102
|
$ as real_uri,
|
|
2092
2103
|
J as tokenStorage
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/utils",
|
|
3
|
-
"version": "7.0.1-beta.
|
|
3
|
+
"version": "7.0.1-beta.5",
|
|
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.1-beta.
|
|
12
|
+
"@das-fed/utils": "7.0.1-beta.5",
|
|
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.1-beta.
|
|
25
|
-
"@das-fed/web": "7.0.1-beta.
|
|
24
|
+
"@das-fed/cli": "7.0.1-beta.5",
|
|
25
|
+
"@das-fed/web": "7.0.1-beta.5",
|
|
26
26
|
"@types/js-cookie": "^3.0.6",
|
|
27
27
|
"@types/lodash-es": "^4.17.12",
|
|
28
28
|
"@types/qs": "^6.9.15",
|