@das-fed/upf-utils 6.4.0-dev.210 → 6.4.0-dev.212
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/es5.js +1450 -1438
- package/api-services/index.js +1185 -1172
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/es5.js +955 -967
- package/api-services/modules/app-manage/index.js +770 -793
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/es5.js +955 -967
- package/api-services/modules/authentication/index.js +770 -793
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/es5.js +2 -2
- package/api-services/modules/bems/index.js +2 -7
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/es5.js +967 -955
- package/api-services/modules/contract/index.js +788 -775
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/es5.js +2 -2
- package/api-services/modules/duty-manage/index.js +2 -7
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/es5.js +2 -2
- package/api-services/modules/enterpriseright/index.js +2 -7
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/es5.js +2 -2
- package/api-services/modules/file/es5.js +1243 -1255
- package/api-services/modules/file/index.js +1036 -1059
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/es5.js +955 -967
- package/api-services/modules/gateway-edge/index.js +770 -793
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +2 -7
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/es5.js +850 -847
- package/api-services/modules/iot/index.js +661 -662
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/es5.js +803 -801
- package/api-services/modules/justauth/index.js +624 -625
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/es5.js +955 -967
- package/api-services/modules/knowledge/index.js +770 -793
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/es5.js +940 -931
- package/api-services/modules/link/index.js +764 -755
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/es5.js +955 -967
- package/api-services/modules/permission/index.js +770 -793
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/es5.js +2 -2
- package/api-services/modules/platformManage/index.js +2 -7
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/es5.js +2 -2
- package/api-services/modules/portal/index.js +2 -7
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/es5.js +955 -967
- package/api-services/modules/space-manage/index.js +770 -793
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/es5.js +982 -970
- package/api-services/modules/super-admin/index.js +800 -787
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/es5.js +976 -988
- package/api-services/modules/supplier/index.js +787 -810
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/es5.js +835 -832
- package/api-services/modules/supplychain-manage/index.js +648 -649
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/es5.js +955 -967
- package/api-services/modules/systemConfiguration/index.js +770 -793
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/es5.js +2 -2
- package/api-services/modules/tool/index.js +2 -7
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/es5.js +938 -929
- package/api-services/src/create-service/index.js +763 -754
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/es5.js +22 -24
- package/common-info/getInfoFromUrl/es5.js +40 -40
- package/common-info/getInfoFromUrl/index.js +36 -36
- package/common-info/getInfoFromUrl/index.js.gz +0 -0
- package/common-info/index.js +17 -21
- package/common-info/index.js.gz +0 -0
- package/common-info/set-personal-info/es5.js +22 -22
- package/common-info/set-personal-info/index.js +20 -25
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-tools/extract-file-name/es5.js +2 -2
- package/common-tools/extract-file-name/index.js +2 -7
- package/common-tools/extract-file-name/index.js.gz +0 -0
- package/common-tools/handle-data/es5.js +111 -118
- package/common-tools/handle-data/index.js +86 -89
- package/common-tools/handle-data/index.js.gz +0 -0
- package/create-api-service/check-token/es5.js +125 -127
- package/create-api-service/check-token/index.js +118 -123
- package/create-api-service/check-token/index.js.gz +0 -0
- package/create-api-service/es5.js +2 -2
- package/create-api-service/index.js +2 -7
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/sso/es5.js +3 -3
- package/create-api-service/sso/index.js +3 -8
- package/create-api-service/sso/index.js.gz +0 -0
- package/curring-http/es5.js +2 -2
- package/curring-http/index.js +2 -7
- package/curring-http/index.js.gz +0 -0
- package/front-end/i18n/front-end-page/dasutils_en-US.js +20 -1
- package/front-end/i18n/front-end-page/dasutils_zh-CN.js +19 -1
- package/front-end/i18n/front-end-page/dasutils_zh-MO.js +19 -1
- package/package.json +4 -4
- package/pinyin-first-character/es5.js +1 -1
- package/pinyin-first-character/index.js +1 -1
- package/pinyin-first-character/index.js.gz +0 -0
- package/webSocket-service/es5.js +41 -53
- package/webSocket-service/index.js +40 -50
- package/webSocket-service/index.js.gz +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { getConfig as
|
|
2
|
-
const
|
|
3
|
-
var
|
|
4
|
-
return (((
|
|
5
|
-
},
|
|
6
|
-
const
|
|
1
|
+
import { getConfig as _ } from "@das-fed/upf-utils/config";
|
|
2
|
+
const M = (f) => f === null || typeof f > "u" || f === "", z = (f) => {
|
|
3
|
+
var n;
|
|
4
|
+
return (((n = _()) == null ? void 0 : n.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(f);
|
|
5
|
+
}, A = async (f) => {
|
|
6
|
+
const x = f || {};
|
|
7
7
|
let {
|
|
8
|
-
currentLang:
|
|
9
|
-
baseUrl:
|
|
10
|
-
appName:
|
|
8
|
+
currentLang: n = "zh-CN",
|
|
9
|
+
baseUrl: c = "/",
|
|
10
|
+
appName: h = "jc",
|
|
11
11
|
isPullFrontEnd: L = !0,
|
|
12
12
|
isPullBack: N = !1,
|
|
13
|
-
isDasUI:
|
|
14
|
-
fallbackBaseUrl:
|
|
15
|
-
} =
|
|
16
|
-
(typeof
|
|
17
|
-
let
|
|
18
|
-
Array.isArray(
|
|
19
|
-
const
|
|
13
|
+
isDasUI: O = !1,
|
|
14
|
+
fallbackBaseUrl: a = ""
|
|
15
|
+
} = x;
|
|
16
|
+
(typeof n != "string" || !n) && (n = "zh-CN");
|
|
17
|
+
let l = [];
|
|
18
|
+
Array.isArray(h) ? (l = h.filter((r) => typeof r == "string" && r), l.length === 0 && (l = ["jc"])) : typeof h == "string" && h ? l = [h] : l = ["jc"], typeof c != "string" && (c = "/"), c || (c = "/"), c.endsWith("/") || (c = c + "/"), typeof a != "string" && (a = ""), a && !a.endsWith("/") && (a = a + "/");
|
|
19
|
+
const y = {
|
|
20
20
|
frontEnd: null,
|
|
21
21
|
// 统一格式:{ appName1: data1, appName2: data2, ... }
|
|
22
22
|
dasUiEnd: null,
|
|
@@ -24,116 +24,113 @@ const _ = (u) => u === null || typeof u > "u" || u === "", S = (u) => {
|
|
|
24
24
|
// 统一格式:{ appName1: data1, appName2: data2, ... }
|
|
25
25
|
};
|
|
26
26
|
let m = !1;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
27
|
+
const j = async (r, s, $ = "zh-CN", w = "资源") => {
|
|
28
|
+
const u = async (i) => {
|
|
29
29
|
try {
|
|
30
30
|
if (typeof window < "u" && typeof window.fetch == "function") {
|
|
31
|
-
const
|
|
32
|
-
return !
|
|
31
|
+
const o = await window.fetch(i, { cache: "no-cache" });
|
|
32
|
+
return !o || !o.ok ? null : await o.text();
|
|
33
33
|
} else
|
|
34
|
-
return await new Promise((
|
|
34
|
+
return await new Promise((o) => {
|
|
35
35
|
try {
|
|
36
36
|
const t = new XMLHttpRequest();
|
|
37
|
-
t.open("GET",
|
|
38
|
-
t.readyState === 4 &&
|
|
37
|
+
t.open("GET", i, !0), t.onreadystatechange = function() {
|
|
38
|
+
t.readyState === 4 && o(t.status >= 200 && t.status < 300 ? t.responseText : null);
|
|
39
39
|
}, t.onerror = function() {
|
|
40
|
-
|
|
40
|
+
o(null);
|
|
41
41
|
}, t.send();
|
|
42
42
|
} catch {
|
|
43
|
-
|
|
43
|
+
o(null);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
} catch {
|
|
47
47
|
return null;
|
|
48
48
|
}
|
|
49
|
-
},
|
|
50
|
-
if (!
|
|
51
|
-
return
|
|
52
|
-
const t =
|
|
49
|
+
}, F = (i) => {
|
|
50
|
+
if (!i || typeof i != "string")
|
|
51
|
+
return null;
|
|
52
|
+
const t = i.replace(/^\uFEFF/, "").trim();
|
|
53
53
|
if (t.startsWith("{"))
|
|
54
54
|
try {
|
|
55
55
|
const e = JSON.parse(t);
|
|
56
56
|
if (e && typeof e == "object")
|
|
57
57
|
return e;
|
|
58
|
-
} catch
|
|
59
|
-
console.warn("[parseEsmDefault] 纯 JSON 解析失败:", e);
|
|
58
|
+
} catch {
|
|
60
59
|
}
|
|
61
|
-
const
|
|
62
|
-
if (!
|
|
63
|
-
return
|
|
60
|
+
const b = t.match(/export\s+default\s*/);
|
|
61
|
+
if (!b || b.index === void 0)
|
|
62
|
+
return null;
|
|
64
63
|
try {
|
|
65
|
-
let e = t.substring(
|
|
64
|
+
let e = t.substring(b.index);
|
|
66
65
|
if (e = e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|\n)\s*\/\/.*(?=\n|$)/g, "$1").trim(), e = e.replace(/^\s*export\s+default\s*/, "").replace(/;?\s*$/, "").trim(), !e)
|
|
67
|
-
return
|
|
66
|
+
return null;
|
|
68
67
|
try {
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
return
|
|
72
|
-
} catch
|
|
73
|
-
console.warn("[parseEsmDefault] Function 构造器失败:", f);
|
|
68
|
+
const d = new Function(`return ${e}`)();
|
|
69
|
+
if (d && typeof d == "object")
|
|
70
|
+
return d;
|
|
71
|
+
} catch {
|
|
74
72
|
}
|
|
75
73
|
try {
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
return
|
|
79
|
-
let
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
return
|
|
84
|
-
} catch
|
|
85
|
-
console.warn("[parseEsmDefault] JSON 解析失败:", f);
|
|
74
|
+
const g = e.indexOf("{"), d = e.lastIndexOf("}");
|
|
75
|
+
if (g === -1 || d === -1 || d <= g)
|
|
76
|
+
return null;
|
|
77
|
+
let p = e.slice(g, d + 1);
|
|
78
|
+
p = p.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/g, '$1"$2":'), p = p.replace(/'([^'\\]*(\\.[^'\\]*)*)'/g, '"$1"'), p = p.replace(/,\s*([}\]])/g, "$1");
|
|
79
|
+
const E = JSON.parse(p);
|
|
80
|
+
if (E && typeof E == "object")
|
|
81
|
+
return E;
|
|
82
|
+
} catch {
|
|
86
83
|
}
|
|
87
84
|
return null;
|
|
88
|
-
} catch
|
|
89
|
-
return
|
|
85
|
+
} catch {
|
|
86
|
+
return null;
|
|
90
87
|
}
|
|
91
|
-
},
|
|
92
|
-
if (!
|
|
93
|
-
const
|
|
94
|
-
if (!
|
|
95
|
-
return
|
|
96
|
-
const t =
|
|
97
|
-
return t !== null && typeof t == "object" ? t :
|
|
98
|
-
},
|
|
99
|
-
if (
|
|
100
|
-
return
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
104
|
-
return
|
|
88
|
+
}, U = async (i) => {
|
|
89
|
+
if (!i) return null;
|
|
90
|
+
const o = await u(i);
|
|
91
|
+
if (!o)
|
|
92
|
+
return null;
|
|
93
|
+
const t = F(o);
|
|
94
|
+
return t !== null && typeof t == "object" ? t : null;
|
|
95
|
+
}, k = await U(r);
|
|
96
|
+
if (k)
|
|
97
|
+
return k;
|
|
98
|
+
if (s && z($)) {
|
|
99
|
+
const i = await U(s);
|
|
100
|
+
if (i)
|
|
101
|
+
return i;
|
|
105
102
|
}
|
|
106
|
-
return
|
|
103
|
+
return null;
|
|
107
104
|
};
|
|
108
105
|
if (L) {
|
|
109
|
-
const
|
|
110
|
-
for (const
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
`前端业务语言资源(${
|
|
106
|
+
const r = {};
|
|
107
|
+
for (const s of l) {
|
|
108
|
+
const $ = `${c}front-end/i18n/front-end-page/${s}_${n}.js`, w = a ? `${a}front-end/i18n/front-end-page/${s}_${n}.js` : void 0, u = await j(
|
|
109
|
+
$,
|
|
110
|
+
w,
|
|
111
|
+
n,
|
|
112
|
+
`前端业务语言资源(${s})`
|
|
116
113
|
);
|
|
117
|
-
|
|
114
|
+
u && (r[s] = u, m = !0);
|
|
118
115
|
}
|
|
119
|
-
Object.keys(
|
|
116
|
+
Object.keys(r).length > 0 && (y.frontEnd = r);
|
|
120
117
|
}
|
|
121
118
|
if (N) {
|
|
122
|
-
const
|
|
123
|
-
for (const
|
|
124
|
-
const
|
|
125
|
-
|
|
119
|
+
const r = {};
|
|
120
|
+
for (const s of l) {
|
|
121
|
+
const $ = `${c}front-end/i18n/return-msg/${s}_${n}.js`, w = a ? `${a}front-end/i18n/return-msg/${s}_${n}.js` : void 0, u = await j($, w, n, `后端语言资源(${s})`);
|
|
122
|
+
u && (r[s] = u, m = !0);
|
|
126
123
|
}
|
|
127
|
-
Object.keys(
|
|
124
|
+
Object.keys(r).length > 0 && (y.backMsg = r);
|
|
128
125
|
}
|
|
129
|
-
if (
|
|
130
|
-
const
|
|
131
|
-
|
|
126
|
+
if (O) {
|
|
127
|
+
const r = `${c}front-end/i18n/front-end-page/dasui_${n}.js`, s = a ? `${a}front-end/i18n/front-end-page/dasui_${n}.js` : void 0;
|
|
128
|
+
y.dasUiEnd = await j(r, s, n, "UI组件库语言资源"), y.dasUiEnd && (m = !0);
|
|
132
129
|
}
|
|
133
|
-
return
|
|
130
|
+
return y;
|
|
134
131
|
};
|
|
135
132
|
export {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
A as handleI18nData,
|
|
134
|
+
z as isCurrentLangInSysLang,
|
|
135
|
+
M as isEmpty
|
|
139
136
|
};
|
|
Binary file
|