@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.
- package/api-services/index.js +6840 -19720
- package/api-services/modules/app-manage.js +6966 -6
- package/api-services/modules/authentication.js +6966 -6
- package/api-services/modules/bems.js +6970 -11
- package/api-services/modules/contract.js +6966 -6
- package/api-services/modules/duty-manage.js +6970 -10
- package/api-services/modules/enterpriseright.js +6966 -6
- package/api-services/modules/file.js +7108 -353
- package/api-services/modules/gateway-edge.js +6966 -6
- package/api-services/modules/index.js +7163 -437
- package/api-services/modules/iot.js +6979 -19
- package/api-services/modules/justauth.js +6967 -7
- package/api-services/modules/knowledge.js +6966 -6
- package/api-services/modules/link.js +6966 -6
- package/api-services/modules/permission.js +6966 -6
- package/api-services/modules/platformManage.js +6974 -14
- package/api-services/modules/portal.js +6966 -6
- package/api-services/modules/space-manage.js +6966 -6
- package/api-services/modules/super-admin.js +6969 -9
- package/api-services/modules/supplier.js +6968 -8
- package/api-services/modules/supplychain-manage.js +6966 -6
- package/api-services/modules/systemConfiguration.js +6966 -6
- package/api-services/modules/tool.js +6966 -6
- package/api-services/src/create-service.js +6840 -19720
- package/api-services/src/sso.js +1711 -157
- package/api-services/src/util.js +1466 -19
- package/atob/index.js +9 -10
- package/common-info/getIframeUrl.js +14 -11
- package/common-info/index.js +194 -269
- package/common-info/setInfoFromUrl.js +60 -128
- package/common-tools/arr-tools.js +6 -13
- package/common-tools/date-format.js +18 -21
- package/common-tools/get-url-params.js +47 -88
- package/common-tools/handle-data.js +3 -4
- package/common-tools/index.js +108 -204
- package/common-tools/nest-tree-format.js +22 -49
- package/common-tools/obj-tools.js +17 -18
- package/common-tools/setHtmlMinWH.js +6 -10
- package/common-tools/throttled.js +7 -16
- package/config/index.js +8 -25
- package/curring-http/index.js +5150 -17289
- package/directive/auth.js +205 -97
- package/directive/clickOutside.js +25 -49
- package/directive/hoverInside.js +18 -35
- package/directive/index.js +238 -159
- package/directive/utils.js +6 -11
- package/dom-check-in/index.js +7 -15
- package/dom-watcher/index.js +7 -8
- package/hooks/popup-manager/use-zindex.js +17 -36
- package/index.js +242 -191
- package/load-js/index.js +14 -20
- package/oss/index.js +15 -15
- package/package.json +7 -11
- package/pinyin-first-character/index.js +25011 -12217
- package/process-engine-info/index.js +8 -10
- package/pure-image-src/index.js +3 -29
- package/set-personal-info/index.js +1566 -16
- package/size-watcher/index.js +17 -24
- package/style/index.js +62 -103
- package/style/math.js +16 -31
- package/style/style.js +49 -72
- package/token-tools/index.js +1594 -152
- package/vue/hooks/use-model-value.js +9 -10
- package/vue/index.js +9 -10
- package/webSocket-service/index.js +162 -135
- package/with-install/index.js +5 -7
package/atob/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
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
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 };
|
package/common-info/index.js
CHANGED
|
@@ -1,311 +1,236 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
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
|
|
9
|
+
return e;
|
|
15
10
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
27
|
-
return encodeURIComponent(
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
}
|
|
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
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
|
122
|
-
return
|
|
59
|
+
withAttributes: function(s) {
|
|
60
|
+
return I(this.converter, u({}, this.attributes, s));
|
|
123
61
|
},
|
|
124
|
-
withConverter: function
|
|
125
|
-
return
|
|
62
|
+
withConverter: function(s) {
|
|
63
|
+
return I(u({}, this.converter, s), this.attributes);
|
|
126
64
|
}
|
|
127
65
|
},
|
|
128
66
|
{
|
|
129
|
-
attributes: { value: Object.freeze(
|
|
130
|
-
converter: { value: Object.freeze(
|
|
67
|
+
attributes: { value: Object.freeze(t) },
|
|
68
|
+
converter: { value: Object.freeze(e) }
|
|
131
69
|
}
|
|
132
|
-
)
|
|
70
|
+
);
|
|
133
71
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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
|
-
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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
|
-
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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
|
|
287
|
-
|
|
288
|
-
activeKey:
|
|
289
|
-
currentTab:
|
|
290
|
-
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
|
|
294
|
-
|
|
295
|
-
activeKey:
|
|
296
|
-
currentTab:
|
|
297
|
-
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
|
|
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
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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 };
|