@das-fed/utils 6.4.0-test.3.1 → 6.4.0-test.5.1
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/i18n/index.d.ts +68 -0
- package/api-services/i18n/index.js +26 -0
- package/api-services/i18n/index.js.gz +0 -0
- package/api-services/index.js +1070 -1011
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/index.js +671 -642
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +671 -642
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +671 -642
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.js +671 -642
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/index.js +671 -642
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +671 -642
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.js +967 -932
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +671 -642
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +1002 -967
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.js +672 -643
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js +675 -646
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.js +668 -639
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.js +671 -642
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +671 -642
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +676 -647
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.js +671 -642
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +671 -642
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +669 -640
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +669 -640
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.js +671 -642
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +671 -642
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.js +671 -642
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +672 -643
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/index.js +43 -36
- package/common-info/index.js.gz +0 -0
- package/common-info/type.d.ts +17 -3
- package/create-api-service/i18n/index.d.ts +33 -0
- package/create-api-service/i18n/index.js +15 -0
- package/create-api-service/index.js +672 -643
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/sso/index.js +55 -55
- package/create-api-service/sso/index.js.gz +0 -0
- package/package.json +4 -4
- package/token-tools/index.d.ts +6 -1
- package/token-tools/index.js +6 -6
- package/i18n-collection/en.js +0 -21
- package/i18n-collection/zh-CN.js +0 -21
|
Binary file
|
package/common-info/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getConfig as
|
|
2
|
-
import { getUrlParams as
|
|
3
|
-
import { getAccessToken as
|
|
4
|
-
import { getTokenFromQuery as
|
|
5
|
-
const S =
|
|
1
|
+
import { getConfig as p } from "@das-fed/utils/config";
|
|
2
|
+
import { getUrlParams as g } from "@das-fed/utils/common-tools";
|
|
3
|
+
import { getAccessToken as m } from "@das-fed/utils/token-tools";
|
|
4
|
+
import { getTokenFromQuery as f, getProjectInfoFromQuery as d } from "@das-fed/utils/common-info/getInfoFromUrl";
|
|
5
|
+
const S = m, J = () => {
|
|
6
6
|
var n;
|
|
7
7
|
let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
|
|
8
8
|
return {
|
|
@@ -11,9 +11,9 @@ const S = I, O = () => {
|
|
|
11
11
|
flag: e.flag ?? null,
|
|
12
12
|
tenantId: ((n = e == null ? void 0 : e.tenant) == null ? void 0 : n.id) ?? ""
|
|
13
13
|
};
|
|
14
|
-
},
|
|
14
|
+
}, O = () => {
|
|
15
15
|
let e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
|
|
16
|
-
const t =
|
|
16
|
+
const t = p();
|
|
17
17
|
return JSON.stringify(e) === "{}" && t.personalInfo && (e = t.personalInfo), {
|
|
18
18
|
id: e.id ?? "",
|
|
19
19
|
name: e.name ?? "",
|
|
@@ -22,7 +22,7 @@ const S = I, O = () => {
|
|
|
22
22
|
email: e.email ?? "",
|
|
23
23
|
headPicture: e.headPicture ?? ""
|
|
24
24
|
};
|
|
25
|
-
},
|
|
25
|
+
}, P = () => {
|
|
26
26
|
let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
|
|
27
27
|
return {
|
|
28
28
|
userId: e.id ?? "",
|
|
@@ -35,14 +35,21 @@ const S = I, O = () => {
|
|
|
35
35
|
};
|
|
36
36
|
}, b = () => {
|
|
37
37
|
let e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
|
|
38
|
-
const t =
|
|
38
|
+
const t = p();
|
|
39
39
|
return JSON.stringify(e) === "{}" && t.projectInfo && (e = t.projectInfo), {
|
|
40
40
|
id: (e == null ? void 0 : e.id) ?? 0,
|
|
41
|
-
|
|
41
|
+
code: (e == null ? void 0 : e.code) ?? 0,
|
|
42
42
|
name: (e == null ? void 0 : e.name) ?? "",
|
|
43
|
-
|
|
43
|
+
type: (e == null ? void 0 : e.type) ?? null,
|
|
44
|
+
parentId: (e == null ? void 0 : e.parentId) ?? "",
|
|
45
|
+
parentName: (e == null ? void 0 : e.parentName) ?? "",
|
|
46
|
+
parentType: (e == null ? void 0 : e.parentType) ?? null,
|
|
47
|
+
tenantId: (e == null ? void 0 : e.tenant) ?? "",
|
|
48
|
+
isParent: (e == null ? void 0 : e.isParent) ?? !1,
|
|
49
|
+
leaf: (e == null ? void 0 : e.leaf) ?? !1,
|
|
50
|
+
optional: (e == null ? void 0 : e.leaf) ?? !0
|
|
44
51
|
};
|
|
45
|
-
},
|
|
52
|
+
}, T = () => {
|
|
46
53
|
const e = JSON.parse(sessionStorage.getItem("home-config") || "{}");
|
|
47
54
|
return {
|
|
48
55
|
applicationCode: (e == null ? void 0 : e.applicationCode) ?? "",
|
|
@@ -53,13 +60,13 @@ const S = I, O = () => {
|
|
|
53
60
|
type: (e == null ? void 0 : e.type) ?? null
|
|
54
61
|
};
|
|
55
62
|
}, h = (e, t) => {
|
|
56
|
-
const n = "permission-btn", s =
|
|
57
|
-
if (!
|
|
58
|
-
const
|
|
63
|
+
const n = "permission-btn", s = I(), a = g(location.href, "app") || "", r = t || a || s.currentSubAppCode;
|
|
64
|
+
if (!r) return;
|
|
65
|
+
const o = g(location.href, "menu") || "", l = e || o || s.currentSubApp.currentMenuCode, c = JSON.parse(sessionStorage.getItem(n) || "{}");
|
|
59
66
|
if (!c || JSON.stringify(c) === "{}") return;
|
|
60
|
-
const u = c[
|
|
61
|
-
return u && u.length ? u : c[
|
|
62
|
-
},
|
|
67
|
+
const u = c[r][l];
|
|
68
|
+
return u && u.length ? u : c[r]["origin-auth"] ? c[r]["origin-auth"][l] ?? [] : [];
|
|
69
|
+
}, M = (e, t) => h(e, t) ?? [], I = () => {
|
|
63
70
|
const e = JSON.parse(sessionStorage.getItem("subApps") || "{}");
|
|
64
71
|
return {
|
|
65
72
|
appcategorys: e.appcategorys ?? [],
|
|
@@ -70,16 +77,16 @@ const S = I, O = () => {
|
|
|
70
77
|
};
|
|
71
78
|
}, j = (e, t = !1) => {
|
|
72
79
|
var s, a;
|
|
73
|
-
const n =
|
|
80
|
+
const n = I().subAppList;
|
|
74
81
|
if (e)
|
|
75
|
-
return t ? ((s = n == null ? void 0 : n.find((
|
|
82
|
+
return t ? ((s = n == null ? void 0 : n.find((r) => r.code === e)) == null ? void 0 : s.originalMenus) ?? [] : ((a = n == null ? void 0 : n.find((r) => r.code === e)) == null ? void 0 : a.menus) ?? [];
|
|
76
83
|
{
|
|
77
|
-
let
|
|
78
|
-
return t ? n == null || n.forEach((
|
|
79
|
-
o
|
|
80
|
-
}) : n == null || n.forEach((
|
|
81
|
-
o
|
|
82
|
-
}),
|
|
84
|
+
let r = {};
|
|
85
|
+
return t ? n == null || n.forEach((o) => {
|
|
86
|
+
r[o.code] = o.originalMenus ?? [];
|
|
87
|
+
}) : n == null || n.forEach((o) => {
|
|
88
|
+
r[o.code] = o.menus ?? [];
|
|
89
|
+
}), r;
|
|
83
90
|
}
|
|
84
91
|
}, v = () => {
|
|
85
92
|
const e = JSON.parse(sessionStorage.getItem("tabs") || "{}");
|
|
@@ -90,27 +97,27 @@ const S = I, O = () => {
|
|
|
90
97
|
preTab: e.preTab ?? {}
|
|
91
98
|
};
|
|
92
99
|
}, U = () => {
|
|
93
|
-
const e =
|
|
100
|
+
const e = p(), t = sessionStorage.getItem("minioAddress");
|
|
94
101
|
return t || (e.baseURL ? e.baseURL : location.origin);
|
|
95
102
|
}, k = () => ({
|
|
96
103
|
instanceInfo: JSON.parse(sessionStorage.getItem("instance") || "{}").instanceInfo ?? {}
|
|
97
104
|
}), E = () => localStorage.getItem("fav-icon") || "./logo.svg";
|
|
98
|
-
S() ||
|
|
99
|
-
var
|
|
100
|
-
(
|
|
105
|
+
S() || f();
|
|
106
|
+
var i;
|
|
107
|
+
(i = b()) != null && i.id || d();
|
|
101
108
|
export {
|
|
102
109
|
E as getFavIcon,
|
|
103
|
-
|
|
110
|
+
T as getHomeInfo,
|
|
104
111
|
k as getInstanceInfo,
|
|
105
112
|
j as getMenus,
|
|
106
113
|
U as getMinioAddress,
|
|
107
114
|
h as getPageAuth,
|
|
108
|
-
|
|
109
|
-
|
|
115
|
+
M as getPageAuthBtn,
|
|
116
|
+
O as getPersonalInfo,
|
|
110
117
|
b as getProjectInfo,
|
|
111
|
-
|
|
118
|
+
I as getSubApps,
|
|
112
119
|
v as getTabInfo,
|
|
113
|
-
|
|
120
|
+
P as getTenantInfo,
|
|
114
121
|
S as getToken,
|
|
115
|
-
|
|
122
|
+
J as getUserInfo
|
|
116
123
|
};
|
package/common-info/index.js.gz
CHANGED
|
Binary file
|
package/common-info/type.d.ts
CHANGED
|
@@ -56,13 +56,27 @@ export interface HomeInfo {
|
|
|
56
56
|
|
|
57
57
|
export interface ProjectInfo {
|
|
58
58
|
/** 项目id */
|
|
59
|
-
id: string
|
|
60
|
-
/**
|
|
61
|
-
|
|
59
|
+
id: string
|
|
60
|
+
/** 项目编码 */
|
|
61
|
+
code: string
|
|
62
62
|
/** 项目名称 */
|
|
63
63
|
name: string
|
|
64
|
+
/** 项目类型: 1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
|
|
65
|
+
type: string
|
|
66
|
+
/** 父级id */
|
|
67
|
+
parentId?: string
|
|
68
|
+
/** 父级名称 */
|
|
69
|
+
parentName?: string
|
|
70
|
+
/** 父级项目类型:1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
|
|
71
|
+
parentType?: number
|
|
64
72
|
/** 租户id */
|
|
65
73
|
tenantId?: string
|
|
74
|
+
/** 是否父级节点 */
|
|
75
|
+
isParent?: boolean
|
|
76
|
+
/** 是否叶子节点 */
|
|
77
|
+
leaf?: boolean
|
|
78
|
+
/** 是否可用 */
|
|
79
|
+
optional?: boolean
|
|
66
80
|
}
|
|
67
81
|
|
|
68
82
|
export interface SubAppsInfo {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
参数校验错误: {
|
|
3
|
+
'zh-CN': string;
|
|
4
|
+
en: string;
|
|
5
|
+
_appCode: string;
|
|
6
|
+
};
|
|
7
|
+
接口地址未找到: {
|
|
8
|
+
'zh-CN': string;
|
|
9
|
+
en: string;
|
|
10
|
+
_appCode: string;
|
|
11
|
+
};
|
|
12
|
+
服务器内部错误: {
|
|
13
|
+
'zh-CN': string;
|
|
14
|
+
en: string;
|
|
15
|
+
_appCode: string;
|
|
16
|
+
};
|
|
17
|
+
解析错误: {
|
|
18
|
+
'zh-CN': string;
|
|
19
|
+
en: string;
|
|
20
|
+
_appCode: string;
|
|
21
|
+
};
|
|
22
|
+
请求配置异常: {
|
|
23
|
+
'zh-CN': string;
|
|
24
|
+
en: string;
|
|
25
|
+
_appCode: string;
|
|
26
|
+
};
|
|
27
|
+
'\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u60C5\u51B5': {
|
|
28
|
+
'zh-CN': string;
|
|
29
|
+
en: string;
|
|
30
|
+
_appCode: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
参数校验错误: { "zh-CN": "参数校验错误", en: "Parameter Validation Error", _appCode: "framework" },
|
|
3
|
+
接口地址未找到: { "zh-CN": "接口地址未找到", en: "Api endpoint not found", _appCode: "framework" },
|
|
4
|
+
服务器内部错误: { "zh-CN": "服务器内部错误", en: "Internal Server Error", _appCode: "framework" },
|
|
5
|
+
解析错误: { "zh-CN": "解析错误", en: "Parsing Error", _appCode: "framework" },
|
|
6
|
+
请求配置异常: { "zh-CN": "请求配置异常", en: "Request Configuration Error", _appCode: "framework" },
|
|
7
|
+
"网络异常,请检查您的网络情况": {
|
|
8
|
+
"zh-CN": "网络异常,请检查您的网络情况",
|
|
9
|
+
en: "Network error, please check your network status",
|
|
10
|
+
_appCode: "framework"
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
r as default
|
|
15
|
+
};
|