@das-fed/upf-utils 6.4.0-dev.226 → 6.4.0-dev.228
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 +1520 -1526
- package/api-services/index.js +1223 -1237
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/es5.js +313 -310
- package/api-services/modules/app-manage/index.js +292 -292
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/es5.js +313 -310
- package/api-services/modules/authentication/index.js +292 -292
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/es5.js +308 -305
- package/api-services/modules/bems/index.js +287 -287
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/es5.js +313 -310
- package/api-services/modules/contract/index.js +292 -292
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/es5.js +1153 -1159
- package/api-services/modules/duty-manage/index.js +958 -972
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/es5.js +1153 -1162
- package/api-services/modules/enterpriseright/index.js +957 -975
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/es5.js +1518 -1527
- package/api-services/modules/file/es5.js +250 -247
- package/api-services/modules/file/index.js +209 -209
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/es5.js +188 -185
- package/api-services/modules/gateway-edge/index.js +184 -184
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +1221 -1239
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/es5.js +1168 -1177
- package/api-services/modules/iot/index.js +968 -986
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/es5.js +314 -311
- package/api-services/modules/justauth/index.js +293 -293
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/es5.js +313 -310
- package/api-services/modules/knowledge/index.js +292 -292
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/es5.js +313 -310
- package/api-services/modules/link/index.js +292 -292
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/es5.js +1153 -1162
- package/api-services/modules/permission/index.js +957 -975
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/es5.js +312 -309
- package/api-services/modules/platformManage/index.js +287 -287
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/es5.js +1135 -1141
- package/api-services/modules/portal/index.js +941 -955
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/es5.js +1247 -1232
- package/api-services/modules/space-manage/index.js +1042 -1024
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/es5.js +262 -259
- package/api-services/modules/super-admin/index.js +244 -244
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/es5.js +315 -312
- package/api-services/modules/supplier/index.js +292 -292
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/es5.js +1164 -1173
- package/api-services/modules/supplychain-manage/index.js +967 -985
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/es5.js +313 -310
- package/api-services/modules/systemConfiguration/index.js +292 -292
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/es5.js +313 -310
- package/api-services/modules/tool/index.js +292 -292
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/es5.js +311 -308
- package/api-services/src/create-service/index.js +291 -291
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/es5.js +4357 -124
- package/common-info/getPermissionMethod/es5.js +4209 -0
- package/common-info/getPermissionMethod/index.d.ts +26 -0
- package/common-info/getPermissionMethod/index.js +3328 -0
- package/common-info/getPermissionMethod/index.js.gz +0 -0
- package/common-info/index.d.ts +2 -0
- package/common-info/index.js +3414 -63
- package/common-info/index.js.gz +0 -0
- package/common-info/type.d.ts +0 -2
- package/create-api-service/es5.js +1142 -1150
- package/create-api-service/index.d.ts +6 -6
- package/create-api-service/index.js +948 -965
- package/create-api-service/index.js.gz +0 -0
- package/directive/auth/es5.js +63 -44
- package/directive/auth/index.js +42 -33
- package/directive/auth/index.js.gz +0 -0
- package/esm-map.json +7 -1
- package/hooks/use-get-auth/es5.js +13 -17
- package/hooks/use-get-auth/index.js +10 -13
- package/package.json +3 -3
- package/hooks/use-get-auth/apis.d.ts +0 -1
|
Binary file
|
package/directive/auth/es5.js
CHANGED
|
@@ -2,54 +2,73 @@
|
|
|
2
2
|
|
|
3
3
|
var commonInfo = require('@das-fed/upf-utils/common-info/es5');
|
|
4
4
|
var utils = require('@das-fed/upf-utils/directive/utils/es5');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
var A = function A(r) {
|
|
6
|
+
var s = /* @__PURE__ */new Set();
|
|
7
|
+
return r.forEach(function (t) {
|
|
8
|
+
var n = String(t !== null && t !== void 0 ? t : "").trim();
|
|
9
|
+
if (!n) return;
|
|
10
|
+
var i = n.lastIndexOf("."),
|
|
11
|
+
d = n.lastIndexOf("_"),
|
|
12
|
+
c = Math.max(i, d),
|
|
13
|
+
o = c >= 0 ? n.slice(c + 1) : n;
|
|
14
|
+
o && s.add(o);
|
|
15
|
+
}), s;
|
|
11
16
|
},
|
|
12
|
-
|
|
13
|
-
var _ref
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
x = function x(r) {
|
|
18
|
+
var _ref;
|
|
19
|
+
var s = (_ref = r == null ? undefined : r.code) !== null && _ref !== void 0 ? _ref : "";
|
|
20
|
+
var t = false;
|
|
21
|
+
if (!s) return t;
|
|
22
|
+
var n = Array.isArray(s) ? s : [s],
|
|
23
|
+
i = commonInfo.getCurrentModulePermissionData("all"),
|
|
24
|
+
d = Array.isArray(i == null ? undefined : i.idList) ? i.idList : commonInfo.getCurrentModulePermissionData("id"),
|
|
25
|
+
c = Array.isArray(i == null ? undefined : i.codeList) ? i.codeList : commonInfo.getCurrentModulePermissionData("code"),
|
|
26
|
+
o = new Set((Array.isArray(d) ? d : []).map(function (a) {
|
|
27
|
+
return String(a);
|
|
28
|
+
})),
|
|
29
|
+
f = new Set((Array.isArray(c) ? c : []).map(function (a) {
|
|
30
|
+
return String(a);
|
|
31
|
+
})),
|
|
32
|
+
l = n.some(function (a) {
|
|
33
|
+
var e = String(a !== null && a !== void 0 ? a : "").trim();
|
|
34
|
+
return e && !/^[0-9]{3,}$/.test(e) && !e.includes(".") && !e.includes("_");
|
|
35
|
+
}) ? A(f) : /* @__PURE__ */new Set(),
|
|
36
|
+
S = function S(a) {
|
|
37
|
+
if (!a) return false;
|
|
38
|
+
var e = String(a || "").trim();
|
|
39
|
+
if (!e) return false;
|
|
40
|
+
if (e.includes(".") || e.includes("_")) return f.has(e);
|
|
41
|
+
var m = {
|
|
42
|
+
search: "q",
|
|
43
|
+
add: "a",
|
|
44
|
+
"delete": "d",
|
|
45
|
+
edit: "m",
|
|
46
|
+
view: "v"
|
|
47
|
+
}[e] || "";
|
|
48
|
+
return l.has(e) || (m ? l.has(m) : false);
|
|
49
|
+
};
|
|
50
|
+
return (o.size > 0 || f.size > 0) && (t = n.some(function (a) {
|
|
51
|
+
var e = String(a !== null && a !== void 0 ? a : "").trim();
|
|
52
|
+
return e ? /^[0-9]{3,}$/.test(e) ? o.has(e) : S(e) : false;
|
|
53
|
+
}), t) ? true : t;
|
|
35
54
|
},
|
|
36
|
-
|
|
37
|
-
|
|
55
|
+
y = function y(r, s) {
|
|
56
|
+
s === "hide" ? r.classList.remove("is-hide") : (r.removeAttribute("disabled"), r.classList.remove("is-disabled"));
|
|
38
57
|
},
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
typeof
|
|
43
|
-
code:
|
|
58
|
+
M = function M(r, s) {
|
|
59
|
+
var _ref2;
|
|
60
|
+
var t = (r ? s.value : s) || {};
|
|
61
|
+
typeof t == "string" && (t = {
|
|
62
|
+
code: t
|
|
44
63
|
});
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
if (
|
|
48
|
-
if (
|
|
49
|
-
utils.getEl(
|
|
50
|
-
|
|
64
|
+
var n = (_ref2 = t == null ? undefined : t.type) !== null && _ref2 !== void 0 ? _ref2 : "hide",
|
|
65
|
+
i = true;
|
|
66
|
+
if (r && s.oldValue) {
|
|
67
|
+
if (x(s.oldValue) === i) return;
|
|
68
|
+
utils.getEl(r, t).then(function (o) {
|
|
69
|
+
y(o, n);
|
|
51
70
|
});
|
|
52
71
|
}
|
|
53
|
-
return
|
|
72
|
+
return i;
|
|
54
73
|
};
|
|
55
|
-
exports.vAuth =
|
|
74
|
+
exports.vAuth = M;
|
package/directive/auth/index.js
CHANGED
|
@@ -1,38 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEl as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { getCurrentModulePermissionData as u } from "@das-fed/upf-utils/common-info";
|
|
2
|
+
import { getEl as h } from "@das-fed/upf-utils/directive/utils";
|
|
3
|
+
const A = (r) => {
|
|
4
|
+
const s = /* @__PURE__ */ new Set();
|
|
5
|
+
return r.forEach((t) => {
|
|
6
|
+
const n = String(t ?? "").trim();
|
|
7
|
+
if (!n) return;
|
|
8
|
+
const i = n.lastIndexOf("."), d = n.lastIndexOf("_"), c = Math.max(i, d), o = c >= 0 ? n.slice(c + 1) : n;
|
|
9
|
+
o && s.add(o);
|
|
10
|
+
}), s;
|
|
11
|
+
}, x = (r) => {
|
|
12
|
+
const s = (r == null ? void 0 : r.code) ?? "";
|
|
13
|
+
let t = !1;
|
|
14
|
+
if (!s)
|
|
15
|
+
return t;
|
|
16
|
+
const n = Array.isArray(s) ? s : [s], i = u("all"), d = Array.isArray(i == null ? void 0 : i.idList) ? i.idList : u("id"), c = Array.isArray(i == null ? void 0 : i.codeList) ? i.codeList : u("code"), o = new Set((Array.isArray(d) ? d : []).map((a) => String(a))), f = new Set((Array.isArray(c) ? c : []).map((a) => String(a))), l = n.some((a) => {
|
|
17
|
+
const e = String(a ?? "").trim();
|
|
18
|
+
return e && !/^[0-9]{3,}$/.test(e) && !e.includes(".") && !e.includes("_");
|
|
19
|
+
}) ? A(f) : /* @__PURE__ */ new Set(), S = (a) => {
|
|
20
|
+
if (!a) return !1;
|
|
21
|
+
const e = String(a || "").trim();
|
|
22
|
+
if (!e) return !1;
|
|
23
|
+
if (e.includes(".") || e.includes("_")) return f.has(e);
|
|
24
|
+
const m = { search: "q", add: "a", delete: "d", edit: "m", view: "v" }[e] || "";
|
|
25
|
+
return l.has(e) || (m ? l.has(m) : !1);
|
|
26
|
+
};
|
|
27
|
+
return (o.size > 0 || f.size > 0) && (t = n.some((a) => {
|
|
28
|
+
const e = String(a ?? "").trim();
|
|
29
|
+
return e ? /^[0-9]{3,}$/.test(e) ? o.has(e) : S(e) : !1;
|
|
30
|
+
}), t) ? !0 : t;
|
|
31
|
+
}, y = (r, s) => {
|
|
32
|
+
s === "hide" ? r.classList.remove("is-hide") : (r.removeAttribute("disabled"), r.classList.remove("is-disabled"));
|
|
33
|
+
}, M = (r, s) => {
|
|
34
|
+
let t = (r ? s.value : s) || {};
|
|
35
|
+
typeof t == "string" && (t = { code: t });
|
|
36
|
+
const n = (t == null ? void 0 : t.type) ?? "hide", i = !0;
|
|
37
|
+
if (r && s.oldValue) {
|
|
38
|
+
if (x(s.oldValue) === i) return;
|
|
39
|
+
h(r, t).then((o) => {
|
|
40
|
+
y(o, n);
|
|
32
41
|
});
|
|
33
42
|
}
|
|
34
|
-
return
|
|
43
|
+
return i;
|
|
35
44
|
};
|
|
36
45
|
export {
|
|
37
|
-
|
|
46
|
+
M as vAuth
|
|
38
47
|
};
|
|
Binary file
|
package/esm-map.json
CHANGED
|
@@ -150,5 +150,11 @@
|
|
|
150
150
|
"getAuthobj": "/common-info/index",
|
|
151
151
|
"getMenuListnfo": "/common-info/index",
|
|
152
152
|
"setI18nBridge": "/i18n-bridge/index",
|
|
153
|
-
"getI18nBridge": "/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"
|
|
154
160
|
}
|
|
@@ -6,27 +6,23 @@ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.
|
|
|
6
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); }); }; }
|
|
7
7
|
var commonTools = require('@das-fed/upf-utils/common-tools/es5');
|
|
8
8
|
var nextTiken = require('@das-fed/upf-utils/nextTiken/es5');
|
|
9
|
-
var
|
|
10
|
-
var p = "v1",
|
|
11
|
-
l = createApiService.createService("/api/admin/basic-application/log/".concat(p));
|
|
12
|
-
l.post("/dependency/rights/list");
|
|
13
|
-
var w = function w() {
|
|
9
|
+
var l = function l() {
|
|
14
10
|
return {
|
|
15
11
|
getApplication: function () {
|
|
16
12
|
var _getApplication = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t) {
|
|
17
|
-
var
|
|
13
|
+
var i;
|
|
18
14
|
return _regenerator().w(function (_context) {
|
|
19
15
|
while (1) switch (_context.n) {
|
|
20
16
|
case 0:
|
|
21
17
|
_context.n = 1;
|
|
22
18
|
return nextTiken.projectNextTick();
|
|
23
19
|
case 1:
|
|
24
|
-
|
|
20
|
+
i = JSON.parse(sessionStorage.getItem("menuList") || "[]").filter(function (e) {
|
|
25
21
|
return e.type === "application";
|
|
26
22
|
});
|
|
27
|
-
return _context.a(2, t ?
|
|
23
|
+
return _context.a(2, t ? i.find(function (e) {
|
|
28
24
|
return e.appId === t;
|
|
29
|
-
}) :
|
|
25
|
+
}) : i);
|
|
30
26
|
}
|
|
31
27
|
}, _callee);
|
|
32
28
|
}));
|
|
@@ -37,15 +33,15 @@ var w = function w() {
|
|
|
37
33
|
}(),
|
|
38
34
|
getMenu: function () {
|
|
39
35
|
var _getMenu = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(t, n) {
|
|
40
|
-
var
|
|
36
|
+
var i, e, a;
|
|
41
37
|
return _regenerator().w(function (_context2) {
|
|
42
38
|
while (1) switch (_context2.n) {
|
|
43
39
|
case 0:
|
|
44
40
|
_context2.n = 1;
|
|
45
41
|
return nextTiken.projectNextTick();
|
|
46
42
|
case 1:
|
|
47
|
-
|
|
48
|
-
return
|
|
43
|
+
i = JSON.parse(sessionStorage.getItem("menuList") || "[]"), e = commonTools.flatTree(i).filter(function (r) {
|
|
44
|
+
return r.type === "menu";
|
|
49
45
|
});
|
|
50
46
|
if (!(!t && !n)) {
|
|
51
47
|
_context2.n = 2;
|
|
@@ -53,10 +49,10 @@ var w = function w() {
|
|
|
53
49
|
}
|
|
54
50
|
return _context2.a(2, e);
|
|
55
51
|
case 2:
|
|
56
|
-
return _context2.a(2, (t ? a = e.find(function (
|
|
57
|
-
return
|
|
58
|
-
}) : n && (a = e.find(function (
|
|
59
|
-
return
|
|
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;
|
|
60
56
|
})), a));
|
|
61
57
|
}
|
|
62
58
|
}, _callee2);
|
|
@@ -68,4 +64,4 @@ var w = function w() {
|
|
|
68
64
|
}()
|
|
69
65
|
};
|
|
70
66
|
};
|
|
71
|
-
exports.useGetAuth =
|
|
67
|
+
exports.useGetAuth = l;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import { flatTree as
|
|
2
|
-
import { projectNextTick as
|
|
3
|
-
|
|
4
|
-
const p = "v1", l = c(`/api/admin/basic-application/log/${p}`);
|
|
5
|
-
l.post("/dependency/rights/list");
|
|
6
|
-
const w = () => ({
|
|
1
|
+
import { flatTree as o } from "@das-fed/upf-utils/common-tools";
|
|
2
|
+
import { projectNextTick as s } from "@das-fed/upf-utils/nextTiken";
|
|
3
|
+
const l = () => ({
|
|
7
4
|
getApplication: async (t) => {
|
|
8
|
-
await
|
|
9
|
-
const
|
|
10
|
-
return t ?
|
|
5
|
+
await s();
|
|
6
|
+
const i = JSON.parse(sessionStorage.getItem("menuList") || "[]").filter((e) => e.type === "application");
|
|
7
|
+
return t ? i.find((e) => e.appId === t) : i;
|
|
11
8
|
},
|
|
12
9
|
getMenu: async (t, n) => {
|
|
13
|
-
await
|
|
14
|
-
const
|
|
10
|
+
await s();
|
|
11
|
+
const i = JSON.parse(sessionStorage.getItem("menuList") || "[]"), e = o(i).filter((r) => r.type === "menu");
|
|
15
12
|
if (!t && !n) return e;
|
|
16
13
|
let a;
|
|
17
|
-
return t ? a = e.find((
|
|
14
|
+
return t ? a = e.find((r) => r.routeCode === t || r.originalCode === t) : n && (a = e.find((r) => r.routeUrl === n)), a;
|
|
18
15
|
}
|
|
19
16
|
});
|
|
20
17
|
export {
|
|
21
|
-
|
|
18
|
+
l as useGetAuth
|
|
22
19
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/upf-utils",
|
|
3
|
-
"version": "6.4.0-dev.
|
|
3
|
+
"version": "6.4.0-dev.228",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@babel/preset-env": "7.26.0",
|
|
24
|
-
"@das-fed/upf-cli": "6.4.0-dev.
|
|
25
|
-
"@das-fed/upf-web": "6.4.0-dev.
|
|
24
|
+
"@das-fed/upf-cli": "6.4.0-dev.228",
|
|
25
|
+
"@das-fed/upf-web": "6.4.0-dev.228",
|
|
26
26
|
"@rollup/plugin-babel": "6.0.4",
|
|
27
27
|
"@types/js-cookie": "^3.0.6",
|
|
28
28
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getRightsListApi: any;
|