@das-fed/upf-utils 6.4.0-dev.157 → 6.4.0-dev.159
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/modules/contract/index.js +836 -818
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +662 -658
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.js +950 -932
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +818 -836
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +926 -936
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.js +1094 -1076
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js +837 -819
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.js +836 -818
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.js +662 -658
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +818 -836
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +656 -660
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +662 -658
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +789 -807
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-tools/handle-data/index.d.ts +7 -1
- package/common-tools/handle-data/index.js +61 -13
- package/common-tools/handle-data/index.js.gz +0 -0
- package/create-api-service/check-token/index.d.ts +2 -1
- package/create-api-service/check-token/index.js +2 -3
- package/create-api-service/check-token/index.js.gz +0 -0
- package/create-api-service/index.js +807 -789
- package/create-api-service/index.js.gz +0 -0
- package/esm-map.json +5 -2
- package/package.json +4 -4
|
Binary file
|
|
@@ -4,8 +4,14 @@
|
|
|
4
4
|
* @returns
|
|
5
5
|
*/
|
|
6
6
|
export declare const isEmpty: (value: any) => boolean;
|
|
7
|
+
export declare const getSysLangArr: (langArr: string[]) => any;
|
|
8
|
+
export declare const getCurrentSysLang: {};
|
|
7
9
|
/**
|
|
8
10
|
* 处理多语言在打包时的数据
|
|
9
11
|
* @param opt
|
|
10
|
-
*/
|
|
12
|
+
*/
|
|
11
13
|
export declare const handleI18nData: (opt: any) => unknown;
|
|
14
|
+
/**
|
|
15
|
+
* 处理不同语言包中公共的全局变量
|
|
16
|
+
*/
|
|
17
|
+
export declare const handleGlobalI18n: (pathname?: string) => unknown;
|
|
@@ -1,17 +1,65 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const y = (e) => e === null || typeof e > "u" || e === "", c = [
|
|
2
|
+
"zh-CN",
|
|
3
|
+
"zh-TW",
|
|
4
|
+
"zh-HK",
|
|
5
|
+
"en",
|
|
6
|
+
"ja",
|
|
7
|
+
"ko",
|
|
8
|
+
"fr",
|
|
9
|
+
"de",
|
|
10
|
+
"es",
|
|
11
|
+
"it",
|
|
12
|
+
"pt",
|
|
13
|
+
"ru",
|
|
14
|
+
"ar",
|
|
15
|
+
"hi",
|
|
16
|
+
"nl",
|
|
17
|
+
"tr",
|
|
18
|
+
"vi",
|
|
19
|
+
"sv",
|
|
20
|
+
"pl",
|
|
21
|
+
"th"
|
|
22
|
+
], u = (e) => c.filter((t) => e.includes(t)), f = ["zh-CN", "en", "ar"];
|
|
23
|
+
async function h(e) {
|
|
24
|
+
try {
|
|
25
|
+
const t = await fetch(e, { method: "HEAD" });
|
|
26
|
+
if (t != null && t.ok) {
|
|
27
|
+
const n = t.headers.get("content-type");
|
|
28
|
+
return !!(n && n.includes("text/javascript"));
|
|
11
29
|
}
|
|
12
|
-
|
|
30
|
+
return !1;
|
|
31
|
+
} catch {
|
|
32
|
+
return !1;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const p = async (e) => {
|
|
36
|
+
try {
|
|
37
|
+
let { pathname: t = "front-end", urlPrefix: n = "", langArr: r = ["zh-CN", "en"] } = e || {}, s = {}, i = u(f);
|
|
38
|
+
for (let a of i)
|
|
39
|
+
if (!s[a]) {
|
|
40
|
+
let o = `${n}i18n/${t}/${a}.js`;
|
|
41
|
+
if (!await h(o))
|
|
42
|
+
continue;
|
|
43
|
+
const l = await import(
|
|
44
|
+
/* @vite-ignore */
|
|
45
|
+
`${n}i18n/${t}/${a}.js`
|
|
46
|
+
);
|
|
47
|
+
s[a] = (l == null ? void 0 : l.default) || null;
|
|
48
|
+
}
|
|
49
|
+
return s;
|
|
50
|
+
} catch {
|
|
51
|
+
}
|
|
52
|
+
}, g = async (e = "front-end") => {
|
|
53
|
+
let t = {}, r = await import(
|
|
54
|
+
/* @vite-ignore */
|
|
55
|
+
`/i18n/${e}/global.js`
|
|
56
|
+
);
|
|
57
|
+
return t = (r == null ? void 0 : r.default) || {}, t;
|
|
13
58
|
};
|
|
14
59
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
60
|
+
f as getCurrentSysLang,
|
|
61
|
+
u as getSysLangArr,
|
|
62
|
+
g as handleGlobalI18n,
|
|
63
|
+
p as handleI18nData,
|
|
64
|
+
y as isEmpty
|
|
17
65
|
};
|
|
Binary file
|
|
@@ -13,4 +13,5 @@ export interface RefreshDataType {
|
|
|
13
13
|
* @param retryCount 内部重试计数器(外部调用无需传递)
|
|
14
14
|
* @returns 有效的 access_token
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
declare const getValidAccessToken: (tokenData: RefreshDataType, updateTokenCallback: (newToken: RefreshDataType) => void, retryCount?: number) => Promise<string>;
|
|
17
|
+
export { getValidAccessToken };
|
|
@@ -1696,8 +1696,7 @@ const {
|
|
|
1696
1696
|
mergeConfig: rr
|
|
1697
1697
|
} = E, { baseURL: Dn } = st();
|
|
1698
1698
|
let W = !1, q = [];
|
|
1699
|
-
const Ne = 1 * 60 * 1e3, Pe = 1, _e = 1e3
|
|
1700
|
-
async function jn(e, t, n = 0) {
|
|
1699
|
+
const Ne = 1 * 60 * 1e3, Pe = 1, _e = 1e3, jn = async (e, t, n = 0) => {
|
|
1701
1700
|
const r = Date.now();
|
|
1702
1701
|
if (r < +e.accessExp - Ne)
|
|
1703
1702
|
return e.accessToken;
|
|
@@ -1725,7 +1724,7 @@ async function jn(e, t, n = 0) {
|
|
|
1725
1724
|
}
|
|
1726
1725
|
return Fe(), Promise.reject("Token refresh failed after retries");
|
|
1727
1726
|
}
|
|
1728
|
-
}
|
|
1727
|
+
};
|
|
1729
1728
|
async function rt(e, t, n, r = 0) {
|
|
1730
1729
|
try {
|
|
1731
1730
|
let s = await E.create().post(
|
|
Binary file
|