@das-fed/utils 1.0.0 → 1.0.2

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.
Files changed (66) hide show
  1. package/api-services/index.js +6840 -19720
  2. package/api-services/modules/app-manage.js +6966 -6
  3. package/api-services/modules/authentication.js +6966 -6
  4. package/api-services/modules/bems.js +6970 -11
  5. package/api-services/modules/contract.js +6966 -6
  6. package/api-services/modules/duty-manage.js +6970 -10
  7. package/api-services/modules/enterpriseright.js +6966 -6
  8. package/api-services/modules/file.js +7108 -353
  9. package/api-services/modules/gateway-edge.js +6966 -6
  10. package/api-services/modules/index.js +7163 -437
  11. package/api-services/modules/iot.js +6979 -19
  12. package/api-services/modules/justauth.js +6967 -7
  13. package/api-services/modules/knowledge.js +6966 -6
  14. package/api-services/modules/link.js +6966 -6
  15. package/api-services/modules/permission.js +6966 -6
  16. package/api-services/modules/platformManage.js +6974 -14
  17. package/api-services/modules/portal.js +6966 -6
  18. package/api-services/modules/space-manage.js +6966 -6
  19. package/api-services/modules/super-admin.js +6969 -9
  20. package/api-services/modules/supplier.js +6968 -8
  21. package/api-services/modules/supplychain-manage.js +6966 -6
  22. package/api-services/modules/systemConfiguration.js +6966 -6
  23. package/api-services/modules/tool.js +6966 -6
  24. package/api-services/src/create-service.js +6840 -19720
  25. package/api-services/src/sso.js +1711 -157
  26. package/api-services/src/util.js +1466 -19
  27. package/atob/index.js +9 -10
  28. package/common-info/getIframeUrl.js +14 -11
  29. package/common-info/index.js +194 -269
  30. package/common-info/setInfoFromUrl.js +60 -128
  31. package/common-tools/arr-tools.js +6 -13
  32. package/common-tools/date-format.js +18 -21
  33. package/common-tools/get-url-params.js +47 -88
  34. package/common-tools/handle-data.js +3 -4
  35. package/common-tools/index.js +108 -204
  36. package/common-tools/nest-tree-format.js +22 -49
  37. package/common-tools/obj-tools.js +17 -18
  38. package/common-tools/setHtmlMinWH.js +6 -10
  39. package/common-tools/throttled.js +7 -16
  40. package/config/index.js +8 -25
  41. package/curring-http/index.js +5150 -17289
  42. package/directive/auth.js +205 -97
  43. package/directive/clickOutside.js +25 -49
  44. package/directive/hoverInside.js +18 -35
  45. package/directive/index.js +238 -159
  46. package/directive/utils.js +6 -11
  47. package/dom-check-in/index.js +7 -15
  48. package/dom-watcher/index.js +7 -8
  49. package/hooks/popup-manager/use-zindex.js +17 -36
  50. package/index.js +242 -191
  51. package/load-js/index.js +14 -20
  52. package/oss/index.js +15 -15
  53. package/package.json +7 -11
  54. package/pinyin-first-character/index.js +25011 -12217
  55. package/process-engine-info/index.js +8 -10
  56. package/pure-image-src/index.js +3 -29
  57. package/set-personal-info/index.js +1566 -16
  58. package/size-watcher/index.js +17 -24
  59. package/style/index.js +62 -103
  60. package/style/math.js +16 -31
  61. package/style/style.js +49 -72
  62. package/token-tools/index.js +1594 -152
  63. package/vue/hooks/use-model-value.js +9 -10
  64. package/vue/index.js +9 -10
  65. package/webSocket-service/index.js +162 -135
  66. package/with-install/index.js +5 -7
package/atob/index.js CHANGED
@@ -1,12 +1,11 @@
1
- const encryption = (str) => {
2
- var encStr = encodeURIComponent(str);
3
- encStr = btoa(encStr);
4
- return encStr;
1
+ const n = (t) => {
2
+ var e = encodeURIComponent(t);
3
+ return e = btoa(e), e;
4
+ }, o = (t) => {
5
+ var e = atob(t);
6
+ return e = decodeURIComponent(e), e;
5
7
  };
6
- const decrypt = (str) => {
7
- var decStr = atob(str);
8
- decStr = decodeURIComponent(decStr);
9
- return decStr;
8
+ export {
9
+ o as decrypt,
10
+ n as encryption
10
11
  };
11
-
12
- export { decrypt, encryption };
@@ -1,13 +1,16 @@
1
- import { getFullPath } from '@das-fed/utils/common-tools';
2
-
3
- const getIframeUrl = (page, query) => {
4
- if (!page)
1
+ const s = (e, n = {}) => {
2
+ let t = "", i = "";
3
+ const r = Object.keys(n);
4
+ return r && r.length && r.forEach((o, l) => {
5
+ l === r.length - 1 ? i += `${o}=${n[o]}` : i += `${o}=${n[o]}&`;
6
+ }), i ? t = location.origin + e + `?${i}` : t = location.origin + e, t;
7
+ }, c = (e, n) => {
8
+ if (!e)
5
9
  return;
6
- let innerQuery = {};
7
- const applicationPath = "enterpriseadmin/iocvisual";
8
- if (page === "preview" || page === "preview3d")
9
- innerQuery = { showLayout: false };
10
- return getFullPath("/" + applicationPath + "/" + page, { ...innerQuery, ...query });
10
+ let t = {};
11
+ const i = "enterpriseadmin/iocvisual";
12
+ return (e === "preview" || e === "preview3d") && (t = { showLayout: !1 }), s("/" + i + "/" + e, { ...t, ...n });
13
+ };
14
+ export {
15
+ c as getIframeUrl
11
16
  };
12
-
13
- export { getIframeUrl };
@@ -1,311 +1,236 @@
1
- import { tokenStorage } from '@das-fed/utils/api-services/src/sso';
2
- import { getConfig } from '@das-fed/utils/config';
3
- import { getUrlParams } from '@das-fed/utils/common-tools';
4
-
1
+ import { ref as d } from "vue";
5
2
  /*! js-cookie v3.0.5 | MIT */
6
- /* eslint-disable no-var */
7
- function assign (target) {
8
- for (var i = 1; i < arguments.length; i++) {
9
- var source = arguments[i];
10
- for (var key in source) {
11
- target[key] = source[key];
12
- }
3
+ function u(e) {
4
+ for (var t = 1; t < arguments.length; t++) {
5
+ var n = arguments[t];
6
+ for (var o in n)
7
+ e[o] = n[o];
13
8
  }
14
- return target
9
+ return e;
15
10
  }
16
- /* eslint-enable no-var */
17
-
18
- /* eslint-disable no-var */
19
- var defaultConverter = {
20
- read: function (value) {
21
- if (value[0] === '"') {
22
- value = value.slice(1, -1);
23
- }
24
- return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
11
+ var l = {
12
+ read: function(e) {
13
+ return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
25
14
  },
26
- write: function (value) {
27
- return encodeURIComponent(value).replace(
15
+ write: function(e) {
16
+ return encodeURIComponent(e).replace(
28
17
  /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
29
18
  decodeURIComponent
30
- )
19
+ );
31
20
  }
32
21
  };
33
- /* eslint-enable no-var */
34
-
35
- /* eslint-disable no-var */
36
-
37
- function init (converter, defaultAttributes) {
38
- function set (name, value, attributes) {
39
- if (typeof document === 'undefined') {
40
- return
41
- }
42
-
43
- attributes = assign({}, defaultAttributes, attributes);
44
-
45
- if (typeof attributes.expires === 'number') {
46
- attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
22
+ function I(e, t) {
23
+ function n(s, i, r) {
24
+ if (!(typeof document > "u")) {
25
+ r = u({}, t, r), typeof r.expires == "number" && (r.expires = new Date(Date.now() + r.expires * 864e5)), r.expires && (r.expires = r.expires.toUTCString()), s = encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
26
+ var c = "";
27
+ for (var a in r)
28
+ r[a] && (c += "; " + a, r[a] !== !0 && (c += "=" + r[a].split(";")[0]));
29
+ return document.cookie = s + "=" + e.write(i, s) + c;
47
30
  }
48
- if (attributes.expires) {
49
- attributes.expires = attributes.expires.toUTCString();
50
- }
51
-
52
- name = encodeURIComponent(name)
53
- .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
54
- .replace(/[()]/g, escape);
55
-
56
- var stringifiedAttributes = '';
57
- for (var attributeName in attributes) {
58
- if (!attributes[attributeName]) {
59
- continue
60
- }
61
-
62
- stringifiedAttributes += '; ' + attributeName;
63
-
64
- if (attributes[attributeName] === true) {
65
- continue
66
- }
67
-
68
- // Considers RFC 6265 section 5.2:
69
- // ...
70
- // 3. If the remaining unparsed-attributes contains a %x3B (";")
71
- // character:
72
- // Consume the characters of the unparsed-attributes up to,
73
- // not including, the first %x3B (";") character.
74
- // ...
75
- stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
76
- }
77
-
78
- return (document.cookie =
79
- name + '=' + converter.write(value, name) + stringifiedAttributes)
80
31
  }
81
-
82
- function get (name) {
83
- if (typeof document === 'undefined' || (arguments.length && !name)) {
84
- return
85
- }
86
-
87
- // To prevent the for loop in the first place assign an empty array
88
- // in case there are no cookies at all.
89
- var cookies = document.cookie ? document.cookie.split('; ') : [];
90
- var jar = {};
91
- for (var i = 0; i < cookies.length; i++) {
92
- var parts = cookies[i].split('=');
93
- var value = parts.slice(1).join('=');
94
-
95
- try {
96
- var found = decodeURIComponent(parts[0]);
97
- jar[found] = converter.read(value, found);
98
-
99
- if (name === found) {
100
- break
32
+ function o(s) {
33
+ if (!(typeof document > "u" || arguments.length && !s)) {
34
+ for (var i = document.cookie ? document.cookie.split("; ") : [], r = {}, c = 0; c < i.length; c++) {
35
+ var a = i[c].split("="), f = a.slice(1).join("=");
36
+ try {
37
+ var g = decodeURIComponent(a[0]);
38
+ if (r[g] = e.read(f, g), s === g)
39
+ break;
40
+ } catch {
101
41
  }
102
- } catch (e) {}
42
+ }
43
+ return s ? r[s] : r;
103
44
  }
104
-
105
- return name ? jar[name] : jar
106
45
  }
107
-
108
46
  return Object.create(
109
47
  {
110
- set,
111
- get,
112
- remove: function (name, attributes) {
113
- set(
114
- name,
115
- '',
116
- assign({}, attributes, {
48
+ set: n,
49
+ get: o,
50
+ remove: function(s, i) {
51
+ n(
52
+ s,
53
+ "",
54
+ u({}, i, {
117
55
  expires: -1
118
56
  })
119
57
  );
120
58
  },
121
- withAttributes: function (attributes) {
122
- return init(this.converter, assign({}, this.attributes, attributes))
59
+ withAttributes: function(s) {
60
+ return I(this.converter, u({}, this.attributes, s));
123
61
  },
124
- withConverter: function (converter) {
125
- return init(assign({}, this.converter, converter), this.attributes)
62
+ withConverter: function(s) {
63
+ return I(u({}, this.converter, s), this.attributes);
126
64
  }
127
65
  },
128
66
  {
129
- attributes: { value: Object.freeze(defaultAttributes) },
130
- converter: { value: Object.freeze(converter) }
67
+ attributes: { value: Object.freeze(t) },
68
+ converter: { value: Object.freeze(e) }
131
69
  }
132
- )
70
+ );
133
71
  }
134
-
135
- var api = init(defaultConverter, { path: '/' });
136
-
137
- const getUrlToken = () => {
138
- const search = new URL(location.href).searchParams;
139
- const token = search.get("token") || search.get("accessToken") || search.get("accesstoken") || "";
140
- if (token) {
141
- const tokenInfo = JSON.stringify({ access_token: token });
142
- sessionStorage.setItem("accessToken", token);
143
- sessionStorage.setItem("tokenInfo", tokenInfo);
144
- api.set("accessToken", token);
145
- api.set("accessTokenInfo", tokenInfo);
72
+ var m = I(l, { path: "/" });
73
+ const h = (e) => {
74
+ var t = encodeURIComponent(e);
75
+ return t = btoa(t), t;
76
+ }, p = () => {
77
+ let t = { ...(window == null ? void 0 : window.config) || {} };
78
+ t.rootContainer || (t.rootContainer = "#app"), t.baseURL || (t.baseURL = location.origin), t.ossBaseURL || (t.ossBaseURL = "/oss"), t.ossBaseURL.startsWith("/") && (t.ossBaseURL = `${t.baseURL}/oss`), t.ssoBaseURL || (t.ssoBaseURL = t.baseURL);
79
+ let { microAppName: n, publicPath: o, mainAppName: s } = t;
80
+ return n && !0 && !o && (o = `/${n}/`.replace(/\/\//g, "/")), o || (o = "/"), t.publicPath = o, t.autoOssBucket || (t.autoOssBucket = s || n), t;
81
+ }, S = (e, t) => {
82
+ let n = window.location.search || "";
83
+ if (e && e !== location.href) {
84
+ const s = e.indexOf("?");
85
+ s !== -1 ? n = e.slice(s) : n = "";
146
86
  }
147
- };
148
- const getProjectInfoFromQuery = () => {
149
- const preProject = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
150
- const search = new URL(location.href).searchParams;
151
- const id = search.get("project") || search.get("projectId") || "";
152
- if (!id)
153
- return;
154
- const parentId = search.get("projectParent") || search.get("projectParentId") || preProject?.parentId || "";
155
- const name = search.get("projectName") || preProject?.name || "";
156
- sessionStorage.setItem("project", id);
157
- sessionStorage.setItem("projectInfo", JSON.stringify({ ...preProject, id, name, parentId }));
158
- };
159
-
160
- const isDev = import.meta.env.DEV;
161
- const getToken = () => {
162
- return api.get("accessToken") ?? "";
163
- };
164
- const getUserInfo = () => {
165
- const config = getConfig();
166
- const infoStrict = config?.infoStrict ?? true;
167
- let info = tokenStorage().getData().info;
168
- if (infoStrict) {
169
- if (isDev && config.userInfo)
170
- info = config.userInfo;
171
- } else {
172
- if (config.userInfo)
173
- info = config.userInfo;
87
+ const o = new URLSearchParams(n);
88
+ if (t)
89
+ return o.get(t);
90
+ {
91
+ let s = {};
92
+ for (let [i, r] of o.entries())
93
+ s[i] = r;
94
+ return s;
174
95
  }
175
- const userInfo = {
176
- id: info.sub ?? "",
177
- name: info.name ?? "",
178
- flag: info.flag,
179
- tenantId: info?.tenant ?? info?.tenantId ?? ""
180
- };
181
- return userInfo;
96
+ }, k = (e) => {
97
+ var t, n, o, s;
98
+ sessionStorage.setItem("hotentToken", e.accessToken || ""), sessionStorage.setItem("currentUser", JSON.stringify({ token: e.accessToken || "" })), e.info && JSON.stringify(e.info) !== "{}" && sessionStorage.setItem("hotentUserInfo", JSON.stringify({ id: ((t = e.info) == null ? void 0 : t.sub) ?? "", name: ((n = e.info) == null ? void 0 : n.name) ?? "", flag: (o = e.info) == null ? void 0 : o.flag, tenantId: ((s = e.info) == null ? void 0 : s.tenant) ?? "" }));
182
99
  };
183
- const getPersonalInfo = () => {
184
- const config = getConfig();
185
- const infoStrict = config?.infoStrict ?? true;
186
- let info = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
187
- if (infoStrict) {
188
- if (isDev && config.personalInfo)
189
- info = config.personalInfo;
190
- } else {
191
- if (config.personalInfo)
192
- info = config.personalInfo;
100
+ d(!1);
101
+ p();
102
+ h("das123"), +/* @__PURE__ */ new Date();
103
+ const b = () => {
104
+ const e = "accessToken", t = "accessTokenExpiredAt", n = "refreshToken", o = "tokenInfo", s = "redirectUri";
105
+ return {
106
+ getData: () => ({
107
+ accessToken: sessionStorage.getItem(e) || "",
108
+ accessTokenExpiredAt: Number(sessionStorage.getItem(t) || "0"),
109
+ refreshToken: sessionStorage.getItem(n) || "",
110
+ info: JSON.parse(
111
+ sessionStorage.getItem(o) === "undefined" ? "{}" : sessionStorage.getItem(o) || "{}"
112
+ ),
113
+ redirectUri: sessionStorage.getItem(s) || ""
114
+ }),
115
+ save: (i) => {
116
+ const r = i.accessTokenExpiredAt || 0;
117
+ sessionStorage.setItem(e, i.accessToken || ""), sessionStorage.setItem(t, r.toString()), sessionStorage.setItem(n, i.refreshToken || ""), sessionStorage.setItem(o, JSON.stringify(i.info || {})), i.redirectUri && sessionStorage.setItem(s, i.redirectUri || ""), k(i);
118
+ },
119
+ remove: () => {
120
+ sessionStorage.removeItem(e), sessionStorage.removeItem(t), sessionStorage.removeItem(n), sessionStorage.removeItem(o), sessionStorage.removeItem(s);
121
+ }
122
+ };
123
+ }, A = () => {
124
+ const e = new URL(location.href).searchParams, t = e.get("token") || e.get("accessToken") || e.get("accesstoken") || "";
125
+ if (t) {
126
+ const n = JSON.stringify({ access_token: t });
127
+ sessionStorage.setItem("accessToken", t), sessionStorage.setItem("tokenInfo", n), m.set("accessToken", t), m.set("accessTokenInfo", n);
193
128
  }
194
- const personalInfo = {
195
- id: info.id ?? "",
196
- name: info.name ?? "",
197
- phone: info.phone ?? "",
198
- userName: info.userName ?? "",
199
- email: info.email ?? "",
200
- headPicture: info.headPicture ?? ""
129
+ }, v = () => {
130
+ const e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}"), t = new URL(location.href).searchParams, n = t.get("project") || t.get("projectId") || "";
131
+ if (!n)
132
+ return;
133
+ const o = t.get("projectParent") || t.get("projectParentId") || (e == null ? void 0 : e.parentId) || "", s = t.get("projectName") || (e == null ? void 0 : e.name) || "";
134
+ sessionStorage.setItem("project", n), sessionStorage.setItem("projectInfo", JSON.stringify({ ...e, id: n, name: s, parentId: o }));
135
+ }, T = () => m.get("accessToken") ?? "", C = () => {
136
+ const e = p(), t = (e == null ? void 0 : e.infoStrict) ?? !0;
137
+ let n = b().getData().info;
138
+ return t || e.userInfo && (n = e.userInfo), {
139
+ id: n.sub ?? "",
140
+ name: n.name ?? "",
141
+ flag: n.flag,
142
+ tenantId: (n == null ? void 0 : n.tenant) ?? (n == null ? void 0 : n.tenantId) ?? ""
201
143
  };
202
- return personalInfo;
203
- };
204
- const getTenantInfo = () => {
205
- let info = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
206
- const tenantInfo = {
207
- userId: info.id ?? "",
208
- userName: info.userName ?? "",
209
- name: info.name ?? "",
210
- areaCode: info.areaCode ?? "",
211
- phone: info.phone ?? "",
212
- flag: info.flag ?? null,
213
- tenant: info.tenant ?? {}
144
+ }, N = () => {
145
+ const e = p(), t = (e == null ? void 0 : e.infoStrict) ?? !0;
146
+ let n = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
147
+ return t || e.personalInfo && (n = e.personalInfo), {
148
+ id: n.id ?? "",
149
+ name: n.name ?? "",
150
+ phone: n.phone ?? "",
151
+ userName: n.userName ?? "",
152
+ email: n.email ?? "",
153
+ headPicture: n.headPicture ?? ""
214
154
  };
215
- return tenantInfo;
216
- };
217
- const getProjectInfo = () => {
218
- const config = getConfig();
219
- const infoStrict = config?.infoStrict ?? true;
220
- let info = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
221
- if (infoStrict) {
222
- if (isDev && config.projectInfo)
223
- info = config.projectInfo;
224
- } else {
225
- if (config.projectInfo)
226
- info = config.projectInfo;
227
- }
228
- const projectInfo = {
229
- id: info?.id ?? "",
230
- parentId: info?.parentId ?? "",
231
- name: info?.name ?? "",
232
- tenantId: info?.tenant ?? ""
155
+ }, w = () => {
156
+ let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
157
+ return {
158
+ userId: e.id ?? "",
159
+ userName: e.userName ?? "",
160
+ name: e.name ?? "",
161
+ areaCode: e.areaCode ?? "",
162
+ phone: e.phone ?? "",
163
+ flag: e.flag ?? null,
164
+ tenant: e.tenant ?? {}
233
165
  };
234
- return projectInfo;
235
- };
236
- const getPageAuth = (menuCode, applicationCode) => {
237
- const KEY = "permission-btn";
238
- const config = getConfig();
239
- const subApps = getSubApps();
240
- const urlApp = getUrlParams(location.href, "app") || "";
241
- const realApplicationCode = applicationCode ? applicationCode : urlApp ? urlApp : window.__IN_MICRO_APP__ ? subApps.currentSubAppCode : config.title;
242
- if (!realApplicationCode)
243
- return void 0;
244
- const urlMenu = getUrlParams(location.href, "menu") || "";
245
- const realMenuCode = menuCode ? menuCode : urlMenu ? urlMenu : window.__IN_MICRO_APP__ ? subApps.currentSubApp.currentMenuCode : JSON.parse(sessionStorage.getItem(`${config.title}-tabs`) || "{}").currentTab.code;
246
- const btnInfo = JSON.parse(sessionStorage.getItem(KEY) || "{}");
247
- if (!btnInfo || JSON.stringify(btnInfo) === "{}")
248
- return void 0;
249
- const btnList = btnInfo[realApplicationCode][realMenuCode];
250
- if (btnList && btnList.length)
251
- return btnList;
252
- if (!btnInfo[realApplicationCode]["origin-auth"])
253
- return [];
254
- return btnInfo[realApplicationCode]["origin-auth"][realMenuCode] ?? [];
255
- };
256
- const getPageAuthBtn = (menuCode, applicationCode) => {
257
- const result = getPageAuth(menuCode, applicationCode);
258
- return result ?? [];
259
- };
260
- const getSubApps = () => {
166
+ }, R = () => {
167
+ const e = p(), t = (e == null ? void 0 : e.infoStrict) ?? !0;
168
+ let n = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
169
+ return t || e.projectInfo && (n = e.projectInfo), {
170
+ id: (n == null ? void 0 : n.id) ?? "",
171
+ parentId: (n == null ? void 0 : n.parentId) ?? "",
172
+ name: (n == null ? void 0 : n.name) ?? "",
173
+ tenantId: (n == null ? void 0 : n.tenant) ?? ""
174
+ };
175
+ }, U = (e, t) => {
176
+ const n = "permission-btn", o = p(), s = O(), i = S(location.href, "app") || "", r = t || i || (window.__IN_MICRO_APP__ ? s.currentSubAppCode : o.title);
177
+ if (!r)
178
+ return;
179
+ const c = S(location.href, "menu") || "", a = e || c || (window.__IN_MICRO_APP__ ? s.currentSubApp.currentMenuCode : JSON.parse(sessionStorage.getItem(`${o.title}-tabs`) || "{}").currentTab.code), f = JSON.parse(sessionStorage.getItem(n) || "{}");
180
+ if (!f || JSON.stringify(f) === "{}")
181
+ return;
182
+ const g = f[r][a];
183
+ return g && g.length ? g : f[r]["origin-auth"] ? f[r]["origin-auth"][a] ?? [] : [];
184
+ }, P = (e, t) => U(e, t) ?? [], O = () => {
185
+ var o;
261
186
  if (!window.__IN_MICRO_APP__)
262
187
  return {};
263
- const info = JSON.parse(sessionStorage.getItem("subApps") || "{}");
264
- const flatSubAppList = info.appcategorys?.map((item) => item.apps).flat() ?? [];
265
- const subApps = {
266
- appcategorys: info.appcategorys ?? [],
267
- currentSubApp: info.currentSubApp ?? {},
268
- currentSubAppCode: info.currentSubAppCode ?? "",
269
- flatSubAppList,
270
- subAppList: info.subAppList ?? []
188
+ const e = JSON.parse(sessionStorage.getItem("subApps") || "{}"), t = ((o = e.appcategorys) == null ? void 0 : o.map((s) => s.apps).flat()) ?? [];
189
+ return {
190
+ appcategorys: e.appcategorys ?? [],
191
+ currentSubApp: e.currentSubApp ?? {},
192
+ currentSubAppCode: e.currentSubAppCode ?? "",
193
+ flatSubAppList: t,
194
+ subAppList: e.subAppList ?? []
271
195
  };
272
- return subApps;
273
- };
274
- const getMenus = (appCode) => {
275
- const info = JSON.parse(sessionStorage.getItem("menus") || "{}");
276
- if (appCode) {
277
- return info[appCode] ?? [];
278
- } else {
279
- return info;
280
- }
281
- };
282
- const getTabInfo = () => {
283
- const config = getConfig();
284
- let result = {};
196
+ }, L = (e) => {
197
+ const t = JSON.parse(sessionStorage.getItem("menus") || "{}");
198
+ return e ? t[e] ?? [] : t;
199
+ }, J = () => {
200
+ const e = p();
201
+ let t = {};
285
202
  if (window.__IN_MICRO_APP__) {
286
- const info = JSON.parse(sessionStorage.getItem("tabs") || "{}");
287
- result = {
288
- activeKey: info.activeKey ?? "",
289
- currentTab: info.currentTab ?? {},
290
- tabMap: info.tabMap ?? {}
203
+ const n = JSON.parse(sessionStorage.getItem("tabs") || "{}");
204
+ t = {
205
+ activeKey: n.activeKey ?? "",
206
+ currentTab: n.currentTab ?? {},
207
+ tabMap: n.tabMap ?? {}
291
208
  };
292
209
  } else {
293
- const info = JSON.parse(sessionStorage.getItem(`${config.title}-tabs`) || "{}");
294
- result = {
295
- activeKey: info.activeKey ?? "",
296
- currentTab: info.currentTab ?? {},
297
- tabList: info.tabList ?? []
210
+ const n = JSON.parse(sessionStorage.getItem(`${e.title}-tabs`) || "{}");
211
+ t = {
212
+ activeKey: n.activeKey ?? "",
213
+ currentTab: n.currentTab ?? {},
214
+ tabList: n.tabList ?? []
298
215
  };
299
216
  }
300
- return result;
217
+ return t;
218
+ }, j = () => {
219
+ const e = p(), t = sessionStorage.getItem("minioAddress");
220
+ return t || (e.baseURL ? e.baseURL : location.origin);
301
221
  };
302
- const getMinioAddress = () => {
303
- const config = getConfig();
304
- const minioAddress = sessionStorage.getItem("minioAddress");
305
- return minioAddress ? minioAddress : config.baseURL ? config.baseURL : location.origin;
222
+ T() || A();
223
+ v();
224
+ export {
225
+ L as getMenus,
226
+ j as getMinioAddress,
227
+ U as getPageAuth,
228
+ P as getPageAuthBtn,
229
+ N as getPersonalInfo,
230
+ R as getProjectInfo,
231
+ O as getSubApps,
232
+ J as getTabInfo,
233
+ w as getTenantInfo,
234
+ T as getToken,
235
+ C as getUserInfo
306
236
  };
307
- if (!getToken())
308
- getUrlToken();
309
- getProjectInfoFromQuery();
310
-
311
- export { getMenus, getMinioAddress, getPageAuth, getPageAuthBtn, getPersonalInfo, getProjectInfo, getSubApps, getTabInfo, getTenantInfo, getToken, getUserInfo };