@das-fed/upf-utils 6.4.0-hot.8 → 6.4.0-test.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-services/es5.js +1576 -1470
- package/api-services/index.js +1067 -1032
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/es5.js +1359 -1266
- package/api-services/modules/app-manage/index.js +1071 -1055
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/es5.js +1316 -1223
- package/api-services/modules/authentication/index.js +1029 -1013
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/es5.js +1819 -1738
- package/api-services/modules/bems/index.js +1422 -1424
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/es5.js +1359 -1266
- package/api-services/modules/contract/index.js +1071 -1055
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/es5.js +1859 -1754
- package/api-services/modules/duty-manage/index.js +1461 -1427
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/es5.js +1359 -1266
- package/api-services/modules/enterpriseright/index.js +1071 -1055
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/es5.js +1880 -1795
- package/api-services/modules/file/es5.js +1460 -1354
- package/api-services/modules/file/index.js +996 -961
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/es5.js +1819 -1738
- package/api-services/modules/gateway-edge/index.js +1423 -1425
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +1337 -1334
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/es5.js +1875 -1770
- package/api-services/modules/iot/index.js +1475 -1441
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/es5.js +1821 -1740
- package/api-services/modules/justauth/index.js +1424 -1426
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/es5.js +1359 -1266
- package/api-services/modules/knowledge/index.js +1071 -1055
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/es5.js +1359 -1266
- package/api-services/modules/link/index.js +1071 -1055
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/es5.js +1850 -1745
- package/api-services/modules/permission/index.js +1456 -1422
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/es5.js +1369 -1276
- package/api-services/modules/platformManage/index.js +1074 -1058
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/es5.js +1359 -1266
- package/api-services/modules/portal/index.js +1071 -1055
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/es5.js +1359 -1266
- package/api-services/modules/space-manage/index.js +1071 -1055
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/es5.js +1390 -1297
- package/api-services/modules/super-admin/index.js +1088 -1072
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/es5.js +1758 -1668
- package/api-services/modules/supplier/index.js +1354 -1342
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/es5.js +1679 -1584
- package/api-services/modules/supplychain-manage/index.js +1303 -1283
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/es5.js +1359 -1266
- package/api-services/modules/systemConfiguration/index.js +1071 -1055
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/es5.js +1850 -1745
- package/api-services/modules/tool/index.js +1456 -1422
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/es5.js +1357 -1264
- package/api-services/src/create-service/index.js +1070 -1055
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/es5.js +4468 -220
- package/common-info/getInfoFromUrl/es5.js +40 -40
- package/common-info/getInfoFromUrl/index.js +36 -36
- package/common-info/getInfoFromUrl/index.js.gz +0 -0
- package/common-info/getPermissionMethod/es5.js +4218 -0
- package/common-info/getPermissionMethod/index.d.ts +26 -0
- package/common-info/getPermissionMethod/index.js +3342 -0
- package/common-info/getPermissionMethod/index.js.gz +0 -0
- package/common-info/index.d.ts +11 -2
- package/common-info/index.js +3540 -187
- package/common-info/index.js.gz +0 -0
- package/common-info/set-personal-info/es5.js +22 -23
- package/common-info/set-personal-info/index.js +20 -26
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-tools/extract-file-name/es5.js +2 -2
- package/common-tools/extract-file-name/index.js +2 -7
- package/common-tools/extract-file-name/index.js.gz +0 -0
- package/common-tools/handle-data/es5.js +111 -118
- package/common-tools/handle-data/index.js +86 -89
- package/common-tools/handle-data/index.js.gz +0 -0
- package/create-api-service/check-token/es5.js +125 -127
- package/create-api-service/check-token/index.js +118 -123
- package/create-api-service/check-token/index.js.gz +0 -0
- package/create-api-service/es5.js +1358 -1264
- package/create-api-service/index.d.ts +7 -7
- package/create-api-service/index.js +1072 -1056
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/sso/es5.js +317 -325
- package/create-api-service/sso/index.js +273 -279
- package/create-api-service/sso/index.js.gz +0 -0
- package/curring-http/es5.js +2 -2
- package/curring-http/index.js +2 -7
- package/curring-http/index.js.gz +0 -0
- package/directive/auth/es5.js +60 -68
- package/directive/auth/index.js +37 -45
- package/directive/auth/index.js.gz +0 -0
- package/esm-map.json +11 -1
- package/hooks/use-get-auth/es5.js +57 -191
- package/hooks/use-get-auth/index.d.ts +2 -7
- package/hooks/use-get-auth/index.js +16 -50
- package/i18n-bridge/es5.js +23 -0
- package/i18n-bridge/index.d.ts +10 -0
- package/i18n-bridge/index.js +16 -0
- package/package.json +3 -4
- package/pinyin-first-character/es5.js +1 -1
- package/pinyin-first-character/index.js +1 -1
- package/pinyin-first-character/index.js.gz +0 -0
- package/webSocket-service/es5.js +41 -53
- package/webSocket-service/index.js +40 -50
- package/webSocket-service/index.js.gz +0 -0
- package/hooks/use-get-auth/apis.d.ts +0 -4
- package/hooks/use-get-auth/index.js.gz +0 -0
|
Binary file
|
package/curring-http/es5.js
CHANGED
|
@@ -1795,12 +1795,12 @@ pe.transitional = function (t, n, r) {
|
|
|
1795
1795
|
}
|
|
1796
1796
|
return function (s, i, c) {
|
|
1797
1797
|
if (t === false) throw new b(o(i, " has been removed" + (n ? " in " + n : "")), b.ERR_DEPRECATED);
|
|
1798
|
-
return n && !et[i] && (et[i] = true
|
|
1798
|
+
return n && !et[i] && (et[i] = true), t ? t(s, i, c) : true;
|
|
1799
1799
|
};
|
|
1800
1800
|
};
|
|
1801
1801
|
pe.spelling = function (t) {
|
|
1802
1802
|
return function (n, r) {
|
|
1803
|
-
return
|
|
1803
|
+
return true;
|
|
1804
1804
|
};
|
|
1805
1805
|
};
|
|
1806
1806
|
function vr(e, t, n) {
|
package/curring-http/index.js
CHANGED
|
@@ -1351,16 +1351,11 @@ pe.transitional = function(t, n, r) {
|
|
|
1351
1351
|
o(i, " has been removed" + (n ? " in " + n : "")),
|
|
1352
1352
|
b.ERR_DEPRECATED
|
|
1353
1353
|
);
|
|
1354
|
-
return n && !et[i] && (et[i] = !0,
|
|
1355
|
-
o(
|
|
1356
|
-
i,
|
|
1357
|
-
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1358
|
-
)
|
|
1359
|
-
)), t ? t(s, i, c) : !0;
|
|
1354
|
+
return n && !et[i] && (et[i] = !0), t ? t(s, i, c) : !0;
|
|
1360
1355
|
};
|
|
1361
1356
|
};
|
|
1362
1357
|
pe.spelling = function(t) {
|
|
1363
|
-
return (n, r) =>
|
|
1358
|
+
return (n, r) => !0;
|
|
1364
1359
|
};
|
|
1365
1360
|
function vr(e, t, n) {
|
|
1366
1361
|
if (typeof e != "object")
|
package/curring-http/index.js.gz
CHANGED
|
Binary file
|
package/directive/auth/es5.js
CHANGED
|
@@ -1,82 +1,74 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
4
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
3
|
var commonInfo = require('@das-fed/upf-utils/common-info/es5');
|
|
7
4
|
var utils = require('@das-fed/upf-utils/directive/utils/es5');
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
5
|
+
var A = function A(e) {
|
|
6
|
+
var _ref;
|
|
7
|
+
var i = (_ref = e == null ? undefined : e.code) !== null && _ref !== void 0 ? _ref : "";
|
|
8
|
+
var t = false;
|
|
9
|
+
if (!i) return t;
|
|
10
|
+
var o = Array.isArray(i) ? i : [i],
|
|
11
|
+
r = commonInfo.getCurrentModulePermissionData("all"),
|
|
12
|
+
a = Array.isArray(r == null ? undefined : r.idList) ? r.idList : commonInfo.getCurrentModulePermissionData("id"),
|
|
13
|
+
c = Array.isArray(r == null ? undefined : r.codeList) ? r.codeList : commonInfo.getCurrentModulePermissionData("code"),
|
|
14
|
+
d = new Set((Array.isArray(a) ? a : []).map(function (n) {
|
|
15
|
+
return String(n);
|
|
16
|
+
})),
|
|
17
|
+
u = new Set((Array.isArray(c) ? c : []).map(function (n) {
|
|
18
|
+
return String(n);
|
|
19
|
+
})),
|
|
20
|
+
y = o.some(function (n) {
|
|
21
|
+
var s = String(n !== null && n !== void 0 ? n : "").trim();
|
|
22
|
+
return s && !/^[0-9]{3,}$/.test(s) && !s.includes(".") && !s.includes("_");
|
|
23
|
+
}),
|
|
24
|
+
L = commonInfo.getCurrentRouteCode(),
|
|
25
|
+
l = y ? commonInfo.buildActionSuffixSet(u, {
|
|
26
|
+
routeCode: L
|
|
27
|
+
}) : /* @__PURE__ */new Set(),
|
|
28
|
+
v = {
|
|
29
|
+
search: "q",
|
|
30
|
+
add: "a",
|
|
31
|
+
"delete": "d",
|
|
32
|
+
edit: "m",
|
|
33
|
+
view: "v"
|
|
34
|
+
},
|
|
35
|
+
w = function w(n) {
|
|
36
|
+
if (!n) return false;
|
|
37
|
+
var s = String(n || "").trim();
|
|
38
|
+
if (!s) return false;
|
|
39
|
+
if (s.includes(".") || s.includes("_")) return u.has(s);
|
|
40
|
+
var m = v[s] || "";
|
|
41
|
+
return l.has(s) || (m ? l.has(m) : false);
|
|
42
|
+
};
|
|
43
|
+
return (d.size > 0 || u.size > 0) && (t = o.some(function (n) {
|
|
44
|
+
var s = String(n !== null && n !== void 0 ? n : "").trim();
|
|
45
|
+
return s ? /^[0-9]{3,}$/.test(s) ? d.has(s) : w(s) : false;
|
|
46
|
+
}), t) ? true : t;
|
|
37
47
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var s = (_ref = e == null ? undefined : e.code) !== null && _ref !== void 0 ? _ref : "";
|
|
41
|
-
var t = (_ref2 = e == null ? undefined : e.menuCode) !== null && _ref2 !== void 0 ? _ref2 : "",
|
|
42
|
-
r = false;
|
|
43
|
-
if (s) {
|
|
44
|
-
var _commonInfo$getMenuIt;
|
|
45
|
-
var f = [];
|
|
46
|
-
if (!t) f = (_commonInfo$getMenuIt = commonInfo.getMenuItemInfo().authCodes) !== null && _commonInfo$getMenuIt !== void 0 ? _commonInfo$getMenuIt : [];else {
|
|
47
|
-
var i = commonInfo.getAuthobj()[t];
|
|
48
|
-
i && (r = i.some(function (l) {
|
|
49
|
-
return l.code === s;
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
r = m(f, s);
|
|
53
|
-
} else t && (r = !!commonInfo.getAuthobj()[t]);
|
|
54
|
-
return r;
|
|
48
|
+
S = function S(e, i) {
|
|
49
|
+
i === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
|
|
55
50
|
},
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
C = function C(e, i) {
|
|
52
|
+
i === "hide" ? e.classList.remove("is-hide") : (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
|
|
58
53
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
A = function A(e, s) {
|
|
63
|
-
var _ref3;
|
|
64
|
-
var t = (e ? s.value : s) || {};
|
|
54
|
+
E = function E(e, i) {
|
|
55
|
+
var _ref2;
|
|
56
|
+
var t = (e ? i.value : i) || {};
|
|
65
57
|
typeof t == "string" && (t = {
|
|
66
58
|
code: t
|
|
67
59
|
});
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
if (e) if (!
|
|
71
|
-
|
|
60
|
+
var o = (_ref2 = t == null ? undefined : t.type) !== null && _ref2 !== void 0 ? _ref2 : "hide",
|
|
61
|
+
r = A(t);
|
|
62
|
+
if (e) if (!i.oldValue) r || utils.getEl(e, t).then(function (a) {
|
|
63
|
+
S(a, o);
|
|
72
64
|
});else {
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
if (
|
|
76
|
-
utils.getEl(e, t).then(function (
|
|
77
|
-
|
|
65
|
+
var a = A(i.oldValue),
|
|
66
|
+
c = r;
|
|
67
|
+
if (a === c) return;
|
|
68
|
+
utils.getEl(e, t).then(function (d) {
|
|
69
|
+
c ? C(d, o) : S(d, o);
|
|
78
70
|
});
|
|
79
71
|
}
|
|
80
|
-
return
|
|
72
|
+
return r;
|
|
81
73
|
};
|
|
82
|
-
exports.vAuth =
|
|
74
|
+
exports.vAuth = E;
|
package/directive/auth/index.js
CHANGED
|
@@ -1,55 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEl as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
let t = !1;
|
|
9
|
-
for (let r of s)
|
|
10
|
-
if (e.find((i) => i.endsWith(r))) {
|
|
11
|
-
t = !0;
|
|
12
|
-
break;
|
|
13
|
-
}
|
|
1
|
+
import { getCurrentModulePermissionData as f, getCurrentRouteCode as g, buildActionSuffixSet as P } from "@das-fed/upf-utils/common-info";
|
|
2
|
+
import { getEl as h } from "@das-fed/upf-utils/directive/utils";
|
|
3
|
+
const A = (e) => {
|
|
4
|
+
const i = (e == null ? void 0 : e.code) ?? "";
|
|
5
|
+
let t = !1;
|
|
6
|
+
if (!i)
|
|
14
7
|
return t;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (!
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
let t = (e ? s.value : s) || {};
|
|
8
|
+
const o = Array.isArray(i) ? i : [i], r = f("all"), a = Array.isArray(r == null ? void 0 : r.idList) ? r.idList : f("id"), c = Array.isArray(r == null ? void 0 : r.codeList) ? r.codeList : f("code"), d = new Set((Array.isArray(a) ? a : []).map((n) => String(n))), u = new Set((Array.isArray(c) ? c : []).map((n) => String(n))), y = o.some((n) => {
|
|
9
|
+
const s = String(n ?? "").trim();
|
|
10
|
+
return s && !/^[0-9]{3,}$/.test(s) && !s.includes(".") && !s.includes("_");
|
|
11
|
+
}), L = g(), l = y ? P(u, { routeCode: L }) : /* @__PURE__ */ new Set(), v = { search: "q", add: "a", delete: "d", edit: "m", view: "v" }, w = (n) => {
|
|
12
|
+
if (!n) return !1;
|
|
13
|
+
const s = String(n || "").trim();
|
|
14
|
+
if (!s) return !1;
|
|
15
|
+
if (s.includes(".") || s.includes("_")) return u.has(s);
|
|
16
|
+
const m = v[s] || "";
|
|
17
|
+
return l.has(s) || (m ? l.has(m) : !1);
|
|
18
|
+
};
|
|
19
|
+
return (d.size > 0 || u.size > 0) && (t = o.some((n) => {
|
|
20
|
+
const s = String(n ?? "").trim();
|
|
21
|
+
return s ? /^[0-9]{3,}$/.test(s) ? d.has(s) : w(s) : !1;
|
|
22
|
+
}), t) ? !0 : t;
|
|
23
|
+
}, S = (e, i) => {
|
|
24
|
+
i === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
|
|
25
|
+
}, C = (e, i) => {
|
|
26
|
+
i === "hide" ? e.classList.remove("is-hide") : (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
|
|
27
|
+
}, E = (e, i) => {
|
|
28
|
+
let t = (e ? i.value : i) || {};
|
|
37
29
|
typeof t == "string" && (t = { code: t });
|
|
38
|
-
const
|
|
30
|
+
const o = (t == null ? void 0 : t.type) ?? "hide", r = A(t);
|
|
39
31
|
if (e)
|
|
40
|
-
if (!
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
if (!i.oldValue)
|
|
33
|
+
r || h(e, t).then((a) => {
|
|
34
|
+
S(a, o);
|
|
43
35
|
});
|
|
44
36
|
else {
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
const a = A(i.oldValue), c = r;
|
|
38
|
+
if (a === c) return;
|
|
39
|
+
h(e, t).then((d) => {
|
|
40
|
+
c ? C(d, o) : S(d, o);
|
|
49
41
|
});
|
|
50
42
|
}
|
|
51
|
-
return
|
|
43
|
+
return r;
|
|
52
44
|
};
|
|
53
45
|
export {
|
|
54
|
-
|
|
46
|
+
E as vAuth
|
|
55
47
|
};
|
|
Binary file
|
package/esm-map.json
CHANGED
|
@@ -148,5 +148,15 @@
|
|
|
148
148
|
"isCurrentLangInSysLang": "/common-tools/handle-data/index",
|
|
149
149
|
"getMenuItemInfo": "/common-info/index",
|
|
150
150
|
"getAuthobj": "/common-info/index",
|
|
151
|
-
"getMenuListnfo": "/common-info/index"
|
|
151
|
+
"getMenuListnfo": "/common-info/index",
|
|
152
|
+
"setI18nBridge": "/i18n-bridge/index",
|
|
153
|
+
"getI18nBridge": "/i18n-bridge/index",
|
|
154
|
+
"groupPermissionListByModuleAndCode": "/common-info/index",
|
|
155
|
+
"getGroupedCurrentUserPermissionList": "/common-info/index",
|
|
156
|
+
"getCurrentModulePermissionData": "/common-info/getPermissionMethod/index",
|
|
157
|
+
"getCurrentUserPermissionsList": "/common-info/getPermissionMethod/index",
|
|
158
|
+
"getCurrentUserMenuPermissionsList": "/common-info/getPermissionMethod/index",
|
|
159
|
+
"handleUnauthorized": "/create-api-service/index",
|
|
160
|
+
"getCurrentRouteCode": "/common-info/index",
|
|
161
|
+
"buildActionSuffixSet": "/common-info/index"
|
|
152
162
|
}
|
|
@@ -1,201 +1,67 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
4
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
6
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
7
3
|
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
8
4
|
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
|
|
9
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
10
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
14
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
15
5
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
16
6
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
17
7
|
var commonTools = require('@das-fed/upf-utils/common-tools/es5');
|
|
18
8
|
var nextTiken = require('@das-fed/upf-utils/nextTiken/es5');
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
return _context.a(2, null);
|
|
60
|
-
case 3:
|
|
61
|
-
f = l.map(function (p) {
|
|
62
|
-
return p.apps;
|
|
63
|
-
}).flat();
|
|
64
|
-
return _context.a(2, r ? f.find(function (p) {
|
|
65
|
-
return p.code === r;
|
|
66
|
-
}) : f);
|
|
67
|
-
}
|
|
68
|
-
}, _callee);
|
|
69
|
-
}));
|
|
70
|
-
return function d(_x) {
|
|
71
|
-
return _ref.apply(this, arguments);
|
|
72
|
-
};
|
|
73
|
-
}(),
|
|
74
|
-
g = /*#__PURE__*/function () {
|
|
75
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(r, i, t) {
|
|
76
|
-
var s,
|
|
77
|
-
c,
|
|
78
|
-
u,
|
|
79
|
-
l,
|
|
80
|
-
_yield$u,
|
|
81
|
-
_yield$u2,
|
|
82
|
-
f,
|
|
83
|
-
e,
|
|
84
|
-
p,
|
|
85
|
-
m,
|
|
86
|
-
o,
|
|
87
|
-
a,
|
|
88
|
-
_ref3,
|
|
89
|
-
n,
|
|
90
|
-
_args2 = arguments;
|
|
91
|
-
return _regenerator().w(function (_context2) {
|
|
92
|
-
while (1) switch (_context2.n) {
|
|
93
|
-
case 0:
|
|
94
|
-
s = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : "enterpriseadmin";
|
|
95
|
-
_context2.n = 1;
|
|
96
|
-
return nextTiken.projectNextTick();
|
|
97
|
-
case 1:
|
|
98
|
-
u = null, l = {
|
|
99
|
-
code: r,
|
|
100
|
-
showBtn: true
|
|
101
|
-
};
|
|
102
|
-
s === "superadmin" ? u = P().run : (l.userType = 1, u = L().run);
|
|
9
|
+
var l = function l() {
|
|
10
|
+
return {
|
|
11
|
+
getApplication: function () {
|
|
12
|
+
var _getApplication = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t) {
|
|
13
|
+
var i;
|
|
14
|
+
return _regenerator().w(function (_context) {
|
|
15
|
+
while (1) switch (_context.n) {
|
|
16
|
+
case 0:
|
|
17
|
+
_context.n = 1;
|
|
18
|
+
return nextTiken.projectNextTick();
|
|
19
|
+
case 1:
|
|
20
|
+
i = JSON.parse(sessionStorage.getItem("menuList") || "[]").filter(function (e) {
|
|
21
|
+
return e.type === "application";
|
|
22
|
+
});
|
|
23
|
+
return _context.a(2, t ? i.find(function (e) {
|
|
24
|
+
return e.appId === t;
|
|
25
|
+
}) : i);
|
|
26
|
+
}
|
|
27
|
+
}, _callee);
|
|
28
|
+
}));
|
|
29
|
+
function getApplication(_x) {
|
|
30
|
+
return _getApplication.apply(this, arguments);
|
|
31
|
+
}
|
|
32
|
+
return getApplication;
|
|
33
|
+
}(),
|
|
34
|
+
getMenu: function () {
|
|
35
|
+
var _getMenu = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(t, n) {
|
|
36
|
+
var i, e, a;
|
|
37
|
+
return _regenerator().w(function (_context2) {
|
|
38
|
+
while (1) switch (_context2.n) {
|
|
39
|
+
case 0:
|
|
40
|
+
_context2.n = 1;
|
|
41
|
+
return nextTiken.projectNextTick();
|
|
42
|
+
case 1:
|
|
43
|
+
i = JSON.parse(sessionStorage.getItem("menuList") || "[]"), e = commonTools.flatTree(i).filter(function (r) {
|
|
44
|
+
return r.type === "menu";
|
|
45
|
+
});
|
|
46
|
+
if (!(!t && !n)) {
|
|
103
47
|
_context2.n = 2;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
case 4:
|
|
122
|
-
p = e != null && e.length ? e.filter(function (n) {
|
|
123
|
-
return n.routeUrl;
|
|
124
|
-
}) : [], m = e != null && e.length ? e.filter(function (n) {
|
|
125
|
-
return !n.routeUrl && n.children;
|
|
126
|
-
}).map(function (n) {
|
|
127
|
-
return n.children;
|
|
128
|
-
}).flat() : [], o = [].concat(_toConsumableArray(p), _toConsumableArray(m));
|
|
129
|
-
if (i) a = o.find(function (n) {
|
|
130
|
-
return n.code === i || n.originalCode === i;
|
|
131
|
-
});else if (t) {
|
|
132
|
-
n = t.replace((_ref3 = (c = o[0]) == null ? undefined : c.applicationPath) !== null && _ref3 !== void 0 ? _ref3 : "", "").replace(/\/\//g, "/");
|
|
133
|
-
a = o.find(function (h) {
|
|
134
|
-
return h.routeUrl && h.routeUrl === n;
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
return _context2.a(2, a);
|
|
138
|
-
}
|
|
139
|
-
}, _callee2);
|
|
140
|
-
}));
|
|
141
|
-
return function g(_x2, _x3, _x4) {
|
|
142
|
-
return _ref2.apply(this, arguments);
|
|
143
|
-
};
|
|
144
|
-
}();
|
|
145
|
-
return {
|
|
146
|
-
getApplication: d,
|
|
147
|
-
getMenu: g,
|
|
148
|
-
getAuth: function () {
|
|
149
|
-
var _getAuth = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(r) {
|
|
150
|
-
var _ref4, _ref5, _ref6;
|
|
151
|
-
var i,
|
|
152
|
-
o,
|
|
153
|
-
t,
|
|
154
|
-
s,
|
|
155
|
-
u,
|
|
156
|
-
e,
|
|
157
|
-
_args3 = arguments;
|
|
158
|
-
return _regenerator().w(function (_context3) {
|
|
159
|
-
while (1) switch (_context3.n) {
|
|
160
|
-
case 0:
|
|
161
|
-
i = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : "enterpriseadmin";
|
|
162
|
-
t = (_ref4 = r == null ? undefined : r.applicationCode) !== null && _ref4 !== void 0 ? _ref4 : "", s = (_ref5 = r == null ? undefined : r.menuCode) !== null && _ref5 !== void 0 ? _ref5 : "", u = (_ref6 = r == null ? undefined : r.code) !== null && _ref6 !== void 0 ? _ref6 : "";
|
|
163
|
-
if (!JSON.parse(sessionStorage.getItem("permission-btn") || "{}")[s]) {
|
|
164
|
-
_context3.n = 1;
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
return _context3.a(2, auth.vAuth(null, {
|
|
168
|
-
applicationCode: t,
|
|
169
|
-
menuCode: s,
|
|
170
|
-
code: u
|
|
171
|
-
}));
|
|
172
|
-
case 1:
|
|
173
|
-
_context3.n = 2;
|
|
174
|
-
return d(t, i);
|
|
175
|
-
case 2:
|
|
176
|
-
if (_context3.v) {
|
|
177
|
-
_context3.n = 3;
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
return _context3.a(2, false);
|
|
181
|
-
case 3:
|
|
182
|
-
_context3.n = 4;
|
|
183
|
-
return g(t, s, i);
|
|
184
|
-
case 4:
|
|
185
|
-
e = _context3.v;
|
|
186
|
-
return _context3.a(2, !e || !(e != null && e.children) || !((o = e.children) != null && o.length) ? false : !!commonTools.flatTree(e.children).find(function (a) {
|
|
187
|
-
var _ref7;
|
|
188
|
-
var c = (_ref7 = a == null ? undefined : a.originalCode) !== null && _ref7 !== void 0 ? _ref7 : a.code;
|
|
189
|
-
return c.includes(s + ".") && (c = c.replace(s + ".", "").replaceAll(".", "-")), c === u;
|
|
190
|
-
}));
|
|
191
|
-
}
|
|
192
|
-
}, _callee3);
|
|
193
|
-
}));
|
|
194
|
-
function getAuth(_x5) {
|
|
195
|
-
return _getAuth.apply(this, arguments);
|
|
196
|
-
}
|
|
197
|
-
return getAuth;
|
|
198
|
-
}()
|
|
199
|
-
};
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
return _context2.a(2, e);
|
|
51
|
+
case 2:
|
|
52
|
+
return _context2.a(2, (t ? a = e.find(function (r) {
|
|
53
|
+
return r.routeCode === t || r.originalCode === t;
|
|
54
|
+
}) : n && (a = e.find(function (r) {
|
|
55
|
+
return r.routeUrl === n;
|
|
56
|
+
})), a));
|
|
57
|
+
}
|
|
58
|
+
}, _callee2);
|
|
59
|
+
}));
|
|
60
|
+
function getMenu(_x2, _x3) {
|
|
61
|
+
return _getMenu.apply(this, arguments);
|
|
62
|
+
}
|
|
63
|
+
return getMenu;
|
|
64
|
+
}()
|
|
200
65
|
};
|
|
201
|
-
|
|
66
|
+
};
|
|
67
|
+
exports.useGetAuth = l;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
export declare const useGetAuth: () => {
|
|
2
|
-
getApplication: (code?: string
|
|
3
|
-
getMenu: (
|
|
4
|
-
getAuth: (options: {
|
|
5
|
-
applicationCode: string;
|
|
6
|
-
menuCode: string;
|
|
7
|
-
code: string;
|
|
8
|
-
}, appName?: "superadmin" | "enterpriseadmin") => unknown;
|
|
2
|
+
getApplication: (code?: string) => unknown;
|
|
3
|
+
getMenu: (menuCode?: string, path?: string) => unknown;
|
|
9
4
|
};
|