@das-fed/utils 7.0.2-beta.4 → 7.0.2-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 +1074 -1073
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/index.js +350 -331
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +880 -843
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +355 -336
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.js +880 -843
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/index.js +356 -337
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +350 -331
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.js +573 -554
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +350 -331
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +613 -594
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.js +1200 -1163
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js +919 -882
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.js +350 -331
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.js +350 -331
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +880 -843
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +867 -830
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.js +350 -331
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +880 -843
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +861 -828
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +352 -333
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.js +350 -331
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +350 -331
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.js +874 -841
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +350 -331
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/index.js +13 -12
- package/common-info/index.js.gz +0 -0
- package/common-info/set-personal-info/index.d.ts +1 -1
- package/common-info/set-personal-info/index.js +253 -237
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-info/type.d.ts +2 -0
- package/common-tools/extract-file-name/index.js +566 -550
- package/common-tools/extract-file-name/index.js.gz +0 -0
- package/common-tools/get-url-params/index.d.ts +7 -0
- package/common-tools/get-url-params/index.js +45 -38
- package/common-tools/get-url-params/index.js.gz +0 -0
- package/common-tools/obj-tools/index.js +1 -1
- package/common-tools/platform-tools/index.d.ts +1 -1
- package/common-tools/platform-tools/index.js +22 -15
- package/create-api-service/index.js +350 -331
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/sso/index.d.ts +3 -3
- package/create-api-service/sso/index.js +602 -564
- package/create-api-service/sso/index.js.gz +0 -0
- package/curring-http/index.js +582 -566
- package/curring-http/index.js.gz +0 -0
- package/esm-map.json +2 -1
- package/hooks/use-get-auth/index.d.ts +1 -1
- package/hooks/use-get-auth/index.js +30 -30
- package/hooks/use-get-auth/index.js.gz +0 -0
- package/package.json +4 -4
- package/process-engine-info/index.js +8 -7
- package/style/index.js +1 -1
- package/style/index.js.gz +0 -0
- package/token-tools/index.js +80 -8
- package/token-tools/index.js.gz +0 -0
- package/vue/hooks/use-model-value/index.d.ts +5 -1
package/curring-http/index.js.gz
CHANGED
|
Binary file
|
package/esm-map.json
CHANGED
|
@@ -142,5 +142,6 @@
|
|
|
142
142
|
"analyApi": "/api-services/modules/iot/index",
|
|
143
143
|
"calcTextWidth": "/common-tools/calc-text-width/index",
|
|
144
144
|
"getFileExtension": "/common-tools/get-file-extension/index",
|
|
145
|
-
"getLanguages": "/common-info/index"
|
|
145
|
+
"getLanguages": "/common-info/index",
|
|
146
|
+
"appendQueryParams": "/common-tools/get-url-params/index"
|
|
146
147
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const useGetAuth: () => {
|
|
2
2
|
getApplication: (code?: string, appName?: "superadmin" | "enterpriseadmin") => unknown;
|
|
3
|
-
getMenu: (code: string, menuCode?: string, path?: string, appName?: "superadmin" | "enterpriseadmin") => unknown;
|
|
3
|
+
getMenu: (code: string, menuCode?: string | null, path?: string | null, appName?: "superadmin" | "enterpriseadmin", ignorePath?: boolean) => unknown;
|
|
4
4
|
getAuth: (options: {
|
|
5
5
|
applicationCode: string;
|
|
6
6
|
menuCode: string;
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { flatTree as
|
|
2
|
-
import { projectNextTick as
|
|
3
|
-
import { vAuth as
|
|
4
|
-
import { portal as
|
|
5
|
-
const
|
|
1
|
+
import { flatTree as M } from "@das-fed/utils/common-tools";
|
|
2
|
+
import { projectNextTick as y } from "@das-fed/utils/nextTiken";
|
|
3
|
+
import { vAuth as T } from "@das-fed/utils/directive/auth";
|
|
4
|
+
import { portal as U, superadminPortal as w, enterpriseright as v } from "@das-fed/utils/api-services/modules";
|
|
5
|
+
const B = U.get("/appcategory"), C = w.get("/appcategory"), L = v.get("/permissionset/user-portal-menu"), P = w.get("/user-menu"), G = () => {
|
|
6
6
|
const d = async (r, i = "enterpriseadmin") => {
|
|
7
7
|
let t = null, s = {};
|
|
8
|
-
await
|
|
9
|
-
const [
|
|
10
|
-
if (
|
|
11
|
-
const
|
|
12
|
-
return r ?
|
|
13
|
-
}, g = async (r, i, t, s = "enterpriseadmin") => {
|
|
14
|
-
var
|
|
15
|
-
await
|
|
16
|
-
let
|
|
8
|
+
await y(), i === "superadmin" ? t = C().run : (s = { userType: 1 }, t = B().run);
|
|
9
|
+
const [o, l] = await t(s);
|
|
10
|
+
if (o || !l || !l.length) return null;
|
|
11
|
+
const p = l.map((e) => e.apps).flat();
|
|
12
|
+
return r ? p.find((e) => e.code === r) : p;
|
|
13
|
+
}, g = async (r, i, t, s = "enterpriseadmin", o = !1) => {
|
|
14
|
+
var h;
|
|
15
|
+
await y();
|
|
16
|
+
let l = null, p = {
|
|
17
17
|
code: r,
|
|
18
18
|
showBtn: !0
|
|
19
19
|
};
|
|
20
|
-
s === "superadmin" ?
|
|
21
|
-
const [
|
|
22
|
-
if (
|
|
20
|
+
s === "superadmin" ? l = P().run : (p.userType = 1, l = L().run);
|
|
21
|
+
const [a, e] = await l(p);
|
|
22
|
+
if (a || !e || !e.length)
|
|
23
23
|
return i || t ? void 0 : [];
|
|
24
24
|
if (!i && !t) return e;
|
|
25
|
-
const
|
|
26
|
-
let
|
|
25
|
+
const m = e != null && e.length ? o ? e : e.filter((n) => n.routeUrl) : [], f = e != null && e.length ? e.filter((n) => !n.routeUrl && n.children).map((n) => n.children).flat() : [], u = [...m, ...f];
|
|
26
|
+
let c;
|
|
27
27
|
if (i)
|
|
28
|
-
|
|
28
|
+
c = u.find((n) => n.code === i || n.originalCode === i);
|
|
29
29
|
else if (t) {
|
|
30
|
-
const n = t.replace(((
|
|
31
|
-
|
|
30
|
+
const n = t.replace(((h = u[0]) == null ? void 0 : h.applicationPath) ?? "", "").replace(/\/\//g, "/");
|
|
31
|
+
c = u.find((A) => A.routeUrl && A.routeUrl === n);
|
|
32
32
|
}
|
|
33
|
-
return
|
|
33
|
+
return c;
|
|
34
34
|
};
|
|
35
35
|
return {
|
|
36
36
|
getApplication: d,
|
|
37
37
|
getMenu: g,
|
|
38
38
|
getAuth: async (r, i = "enterpriseadmin") => {
|
|
39
|
-
var
|
|
40
|
-
const t = (r == null ? void 0 : r.applicationCode) ?? "", s = (r == null ? void 0 : r.menuCode) ?? "",
|
|
41
|
-
if (JSON.parse(sessionStorage.getItem("permission-btn") || "{}")[s]) return
|
|
39
|
+
var f;
|
|
40
|
+
const t = (r == null ? void 0 : r.applicationCode) ?? "", s = (r == null ? void 0 : r.menuCode) ?? "", o = (r == null ? void 0 : r.code) ?? "";
|
|
41
|
+
if (JSON.parse(sessionStorage.getItem("permission-btn") || "{}")[s]) return T(null, { applicationCode: t, menuCode: s, code: o });
|
|
42
42
|
if (!await d(t, i)) return !1;
|
|
43
|
-
const
|
|
44
|
-
return !
|
|
43
|
+
const a = await g(t, s, i);
|
|
44
|
+
return !a || !(a != null && a.children) || !((f = a.children) != null && f.length) ? !1 : !!M(a.children).find((u) => {
|
|
45
45
|
let c = (u == null ? void 0 : u.originalCode) ?? u.code;
|
|
46
|
-
return c.includes(s + ".") && (c = c.replace(s + ".", "").replaceAll(".", "-")), c ===
|
|
46
|
+
return c.includes(s + ".") && (c = c.replace(s + ".", "").replaceAll(".", "-")), c === o;
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
export {
|
|
52
|
-
|
|
52
|
+
G as useGetAuth
|
|
53
53
|
};
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/utils",
|
|
3
|
-
"version": "7.0.2-beta.
|
|
3
|
+
"version": "7.0.2-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.2-beta.
|
|
12
|
+
"@das-fed/utils": "7.0.2-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.2-beta.
|
|
25
|
-
"@das-fed/web": "7.0.2-beta.
|
|
24
|
+
"@das-fed/cli": "7.0.2-beta.5",
|
|
25
|
+
"@das-fed/web": "7.0.2-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",
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const o = (e) => {
|
|
2
|
+
var s;
|
|
3
|
+
(s = window.webConfig) != null && s.disableSaveToken || (sessionStorage.setItem("hotentToken", e.accessToken || ""), sessionStorage.setItem("currentUser", JSON.stringify({ token: e.accessToken || "" })));
|
|
4
|
+
}, n = () => {
|
|
4
5
|
sessionStorage.removeItem("hotentToken"), sessionStorage.removeItem("currentUser");
|
|
5
6
|
}, t = (e) => {
|
|
6
7
|
sessionStorage.setItem("project", e);
|
|
7
|
-
},
|
|
8
|
+
}, r = () => {
|
|
8
9
|
sessionStorage.removeItem("project");
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
r as removeProcessEngineProject,
|
|
13
|
+
n as removeProcessEngineToken,
|
|
13
14
|
t as setProcessEngineProject,
|
|
14
|
-
|
|
15
|
+
o as setProcessEngineToken
|
|
15
16
|
};
|
package/style/index.js
CHANGED
package/style/index.js.gz
CHANGED
|
Binary file
|
package/token-tools/index.js
CHANGED
|
@@ -1,11 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/*! js-cookie v3.0.5 | MIT */
|
|
2
|
+
function l(e) {
|
|
3
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
4
|
+
var n = arguments[t];
|
|
5
|
+
for (var g in n)
|
|
6
|
+
e[g] = n[g];
|
|
7
|
+
}
|
|
8
|
+
return e;
|
|
9
|
+
}
|
|
10
|
+
var k = {
|
|
11
|
+
read: function(e) {
|
|
12
|
+
return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
13
|
+
},
|
|
14
|
+
write: function(e) {
|
|
15
|
+
return encodeURIComponent(e).replace(
|
|
16
|
+
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
17
|
+
decodeURIComponent
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
function d(e, t) {
|
|
22
|
+
function n(r, i, o) {
|
|
23
|
+
if (!(typeof document > "u")) {
|
|
24
|
+
o = l({}, t, o), typeof o.expires == "number" && (o.expires = new Date(Date.now() + o.expires * 864e5)), o.expires && (o.expires = o.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
25
|
+
var c = "";
|
|
26
|
+
for (var s in o)
|
|
27
|
+
o[s] && (c += "; " + s, o[s] !== !0 && (c += "=" + o[s].split(";")[0]));
|
|
28
|
+
return document.cookie = r + "=" + e.write(i, r) + c;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function g(r) {
|
|
32
|
+
if (!(typeof document > "u" || arguments.length && !r)) {
|
|
33
|
+
for (var i = document.cookie ? document.cookie.split("; ") : [], o = {}, c = 0; c < i.length; c++) {
|
|
34
|
+
var s = i[c].split("="), I = s.slice(1).join("=");
|
|
35
|
+
try {
|
|
36
|
+
var f = decodeURIComponent(s[0]);
|
|
37
|
+
if (o[f] = e.read(I, f), r === f)
|
|
38
|
+
break;
|
|
39
|
+
} catch {
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return r ? o[r] : o;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return Object.create(
|
|
46
|
+
{
|
|
47
|
+
set: n,
|
|
48
|
+
get: g,
|
|
49
|
+
remove: function(r, i) {
|
|
50
|
+
n(
|
|
51
|
+
r,
|
|
52
|
+
"",
|
|
53
|
+
l({}, i, {
|
|
54
|
+
expires: -1
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
withAttributes: function(r) {
|
|
59
|
+
return d(this.converter, l({}, this.attributes, r));
|
|
60
|
+
},
|
|
61
|
+
withConverter: function(r) {
|
|
62
|
+
return d(l({}, this.converter, r), this.attributes);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
attributes: { value: Object.freeze(t) },
|
|
67
|
+
converter: { value: Object.freeze(e) }
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
var p = d(k, { path: "/" });
|
|
72
|
+
const a = "accessToken", m = "accessTokenExpiredAt", v = "refreshToken", u = "redirectUri", S = "csrf-token", h = () => localStorage.getItem(a) ?? p.get(a) ?? sessionStorage.getItem(a) ?? "", C = (e) => localStorage.getItem(e) ?? p.get(e) ?? sessionStorage.getItem(e) ?? "", x = (e, t = {}) => {
|
|
73
|
+
var n;
|
|
74
|
+
(n = window.webConfig) != null && n.disableSaveToken || (localStorage.setItem(a, e), localStorage.setItem(m, t.accessTokenExpiredAt ?? "0"), localStorage.setItem(v, t.refreshToken ?? ""), t.redirectUri && localStorage.setItem(u, t.redirectUri));
|
|
75
|
+
}, U = () => {
|
|
76
|
+
localStorage.removeItem(a), localStorage.removeItem(m), localStorage.removeItem(v), localStorage.removeItem(u), localStorage.removeItem(S);
|
|
5
77
|
};
|
|
6
78
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
79
|
+
h as getAccessToken,
|
|
80
|
+
C as getAccessTokenInfo,
|
|
81
|
+
U as removeAccessToken,
|
|
82
|
+
x as setAccessToken
|
|
11
83
|
};
|
|
Binary file
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
|
|
3
3
|
/** 简化组件内使用modelValue时的watch过程 */
|
|
4
|
-
declare const useModelValue: (
|
|
4
|
+
declare const useModelValue: (
|
|
5
|
+
/** 组件的props */
|
|
6
|
+
props: any,
|
|
7
|
+
/** 组件props需要使用modelValue的key */
|
|
8
|
+
propKey: string) => Ref;
|
|
5
9
|
export { useModelValue };
|