@das-fed/upf-utils 6.4.0-hot.8 → 6.4.0-test.0

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 (124) hide show
  1. package/api-services/es5.js +1576 -1470
  2. package/api-services/index.js +1067 -1032
  3. package/api-services/index.js.gz +0 -0
  4. package/api-services/modules/app-manage/es5.js +1359 -1266
  5. package/api-services/modules/app-manage/index.js +1071 -1055
  6. package/api-services/modules/app-manage/index.js.gz +0 -0
  7. package/api-services/modules/authentication/es5.js +1316 -1223
  8. package/api-services/modules/authentication/index.js +1029 -1013
  9. package/api-services/modules/authentication/index.js.gz +0 -0
  10. package/api-services/modules/bems/es5.js +1819 -1738
  11. package/api-services/modules/bems/index.js +1422 -1424
  12. package/api-services/modules/bems/index.js.gz +0 -0
  13. package/api-services/modules/contract/es5.js +1359 -1266
  14. package/api-services/modules/contract/index.js +1071 -1055
  15. package/api-services/modules/contract/index.js.gz +0 -0
  16. package/api-services/modules/duty-manage/es5.js +1859 -1754
  17. package/api-services/modules/duty-manage/index.js +1461 -1427
  18. package/api-services/modules/duty-manage/index.js.gz +0 -0
  19. package/api-services/modules/enterpriseright/es5.js +1359 -1266
  20. package/api-services/modules/enterpriseright/index.js +1071 -1055
  21. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  22. package/api-services/modules/es5.js +1880 -1795
  23. package/api-services/modules/file/es5.js +1460 -1354
  24. package/api-services/modules/file/index.js +996 -961
  25. package/api-services/modules/file/index.js.gz +0 -0
  26. package/api-services/modules/gateway-edge/es5.js +1819 -1738
  27. package/api-services/modules/gateway-edge/index.js +1423 -1425
  28. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  29. package/api-services/modules/index.js +1337 -1334
  30. package/api-services/modules/index.js.gz +0 -0
  31. package/api-services/modules/iot/es5.js +1875 -1770
  32. package/api-services/modules/iot/index.js +1475 -1441
  33. package/api-services/modules/iot/index.js.gz +0 -0
  34. package/api-services/modules/justauth/es5.js +1821 -1740
  35. package/api-services/modules/justauth/index.js +1424 -1426
  36. package/api-services/modules/justauth/index.js.gz +0 -0
  37. package/api-services/modules/knowledge/es5.js +1359 -1266
  38. package/api-services/modules/knowledge/index.js +1071 -1055
  39. package/api-services/modules/knowledge/index.js.gz +0 -0
  40. package/api-services/modules/link/es5.js +1359 -1266
  41. package/api-services/modules/link/index.js +1071 -1055
  42. package/api-services/modules/link/index.js.gz +0 -0
  43. package/api-services/modules/permission/es5.js +1850 -1745
  44. package/api-services/modules/permission/index.js +1456 -1422
  45. package/api-services/modules/permission/index.js.gz +0 -0
  46. package/api-services/modules/platformManage/es5.js +1369 -1276
  47. package/api-services/modules/platformManage/index.js +1074 -1058
  48. package/api-services/modules/platformManage/index.js.gz +0 -0
  49. package/api-services/modules/portal/es5.js +1359 -1266
  50. package/api-services/modules/portal/index.js +1071 -1055
  51. package/api-services/modules/portal/index.js.gz +0 -0
  52. package/api-services/modules/space-manage/es5.js +1359 -1266
  53. package/api-services/modules/space-manage/index.js +1071 -1055
  54. package/api-services/modules/space-manage/index.js.gz +0 -0
  55. package/api-services/modules/super-admin/es5.js +1390 -1297
  56. package/api-services/modules/super-admin/index.js +1088 -1072
  57. package/api-services/modules/super-admin/index.js.gz +0 -0
  58. package/api-services/modules/supplier/es5.js +1758 -1668
  59. package/api-services/modules/supplier/index.js +1354 -1342
  60. package/api-services/modules/supplier/index.js.gz +0 -0
  61. package/api-services/modules/supplychain-manage/es5.js +1679 -1584
  62. package/api-services/modules/supplychain-manage/index.js +1303 -1283
  63. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  64. package/api-services/modules/systemConfiguration/es5.js +1359 -1266
  65. package/api-services/modules/systemConfiguration/index.js +1071 -1055
  66. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  67. package/api-services/modules/tool/es5.js +1850 -1745
  68. package/api-services/modules/tool/index.js +1456 -1422
  69. package/api-services/modules/tool/index.js.gz +0 -0
  70. package/api-services/src/create-service/es5.js +1357 -1264
  71. package/api-services/src/create-service/index.js +1070 -1055
  72. package/api-services/src/create-service/index.js.gz +0 -0
  73. package/common-info/es5.js +4468 -220
  74. package/common-info/getInfoFromUrl/es5.js +40 -40
  75. package/common-info/getInfoFromUrl/index.js +36 -36
  76. package/common-info/getInfoFromUrl/index.js.gz +0 -0
  77. package/common-info/getPermissionMethod/es5.js +4218 -0
  78. package/common-info/getPermissionMethod/index.d.ts +26 -0
  79. package/common-info/getPermissionMethod/index.js +3342 -0
  80. package/common-info/getPermissionMethod/index.js.gz +0 -0
  81. package/common-info/index.d.ts +11 -2
  82. package/common-info/index.js +3540 -187
  83. package/common-info/index.js.gz +0 -0
  84. package/common-info/set-personal-info/es5.js +22 -23
  85. package/common-info/set-personal-info/index.js +20 -26
  86. package/common-info/set-personal-info/index.js.gz +0 -0
  87. package/common-tools/extract-file-name/es5.js +2 -2
  88. package/common-tools/extract-file-name/index.js +2 -7
  89. package/common-tools/extract-file-name/index.js.gz +0 -0
  90. package/common-tools/handle-data/es5.js +111 -118
  91. package/common-tools/handle-data/index.js +86 -89
  92. package/common-tools/handle-data/index.js.gz +0 -0
  93. package/create-api-service/check-token/es5.js +125 -127
  94. package/create-api-service/check-token/index.js +118 -123
  95. package/create-api-service/check-token/index.js.gz +0 -0
  96. package/create-api-service/es5.js +1358 -1264
  97. package/create-api-service/index.d.ts +7 -7
  98. package/create-api-service/index.js +1072 -1056
  99. package/create-api-service/index.js.gz +0 -0
  100. package/create-api-service/sso/es5.js +317 -325
  101. package/create-api-service/sso/index.js +273 -279
  102. package/create-api-service/sso/index.js.gz +0 -0
  103. package/curring-http/es5.js +2 -2
  104. package/curring-http/index.js +2 -7
  105. package/curring-http/index.js.gz +0 -0
  106. package/directive/auth/es5.js +60 -68
  107. package/directive/auth/index.js +37 -45
  108. package/directive/auth/index.js.gz +0 -0
  109. package/esm-map.json +11 -1
  110. package/hooks/use-get-auth/es5.js +57 -191
  111. package/hooks/use-get-auth/index.d.ts +2 -7
  112. package/hooks/use-get-auth/index.js +16 -50
  113. package/i18n-bridge/es5.js +23 -0
  114. package/i18n-bridge/index.d.ts +10 -0
  115. package/i18n-bridge/index.js +16 -0
  116. package/package.json +3 -4
  117. package/pinyin-first-character/es5.js +1 -1
  118. package/pinyin-first-character/index.js +1 -1
  119. package/pinyin-first-character/index.js.gz +0 -0
  120. package/webSocket-service/es5.js +41 -53
  121. package/webSocket-service/index.js +40 -50
  122. package/webSocket-service/index.js.gz +0 -0
  123. package/hooks/use-get-auth/apis.d.ts +0 -4
  124. package/hooks/use-get-auth/index.js.gz +0 -0
@@ -9,52 +9,51 @@ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.
9
9
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
10
10
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
11
  var config = require('@das-fed/upf-utils/config/es5');
12
- var _ = function _(u) {
13
- return u === null || _typeof(u) > "u" || u === "";
12
+ var M = function M(f) {
13
+ return f === null || _typeof(f) > "u" || f === "";
14
14
  },
15
- S = function S(u) {
16
- var r;
17
- return (((r = config.getConfig()) == null ? undefined : r.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(u);
15
+ z = function z(f) {
16
+ var n;
17
+ return (((n = config.getConfig()) == null ? undefined : n.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(f);
18
18
  },
19
- z = /*#__PURE__*/function () {
20
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(u) {
21
- var k, _k$currentLang, r, _k$baseUrl, l, _k$appName, g, _k$isPullFrontEnd, L, _k$isPullBack, N, _k$isDasUI, D, _k$fallbackBaseUrl, c, d, w, m, E, a, _iterator, _step, o, h, i, p, _a, _iterator2, _step2, _o, _h, _i, _p, _a2, _o2, _t3, _t4;
19
+ A = /*#__PURE__*/function () {
20
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(f) {
21
+ var x, _x$currentLang, n, _x$baseUrl, c, _x$appName, h, _x$isPullFrontEnd, L, _x$isPullBack, N, _x$isDasUI, O, _x$fallbackBaseUrl, a, l, y, j, r, _iterator, _step, s, $, w, u, _r, _iterator2, _step2, _s, _$, _w, _u, _r2, _s2, _t3, _t4;
22
22
  return _regenerator().w(function (_context4) {
23
23
  while (1) switch (_context4.p = _context4.n) {
24
24
  case 0:
25
- k = u || {};
26
- _k$currentLang = k.currentLang, r = _k$currentLang === void 0 ? "zh-CN" : _k$currentLang, _k$baseUrl = k.baseUrl, l = _k$baseUrl === void 0 ? "/" : _k$baseUrl, _k$appName = k.appName, g = _k$appName === void 0 ? "jc" : _k$appName, _k$isPullFrontEnd = k.isPullFrontEnd, L = _k$isPullFrontEnd === void 0 ? true : _k$isPullFrontEnd, _k$isPullBack = k.isPullBack, N = _k$isPullBack === void 0 ? false : _k$isPullBack, _k$isDasUI = k.isDasUI, D = _k$isDasUI === void 0 ? false : _k$isDasUI, _k$fallbackBaseUrl = k.fallbackBaseUrl, c = _k$fallbackBaseUrl === void 0 ? "" : _k$fallbackBaseUrl;
27
- (typeof r != "string" || !r) && (r = "zh-CN");
28
- d = [];
29
- Array.isArray(g) ? (d = g.filter(function (a) {
30
- return typeof a == "string" && a;
31
- }), d.length === 0 && (d = ["jc"])) : typeof g == "string" && g ? d = [g] : d = ["jc"], typeof l != "string" && (l = "/"), l || (l = "/"), l.endsWith("/") || (l = l + "/"), typeof c != "string" && (c = ""), c && !c.endsWith("/") && (c = c + "/");
32
- w = {
25
+ x = f || {};
26
+ _x$currentLang = x.currentLang, n = _x$currentLang === void 0 ? "zh-CN" : _x$currentLang, _x$baseUrl = x.baseUrl, c = _x$baseUrl === void 0 ? "/" : _x$baseUrl, _x$appName = x.appName, h = _x$appName === void 0 ? "jc" : _x$appName, _x$isPullFrontEnd = x.isPullFrontEnd, L = _x$isPullFrontEnd === void 0 ? true : _x$isPullFrontEnd, _x$isPullBack = x.isPullBack, N = _x$isPullBack === void 0 ? false : _x$isPullBack, _x$isDasUI = x.isDasUI, O = _x$isDasUI === void 0 ? false : _x$isDasUI, _x$fallbackBaseUrl = x.fallbackBaseUrl, a = _x$fallbackBaseUrl === void 0 ? "" : _x$fallbackBaseUrl;
27
+ (typeof n != "string" || !n) && (n = "zh-CN");
28
+ l = [];
29
+ Array.isArray(h) ? (l = h.filter(function (r) {
30
+ return typeof r == "string" && r;
31
+ }), 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 + "/");
32
+ y = {
33
33
  frontEnd: null,
34
34
  // 统一格式:{ appName1: data1, appName2: data2, ... }
35
35
  dasUiEnd: null,
36
36
  backMsg: null
37
37
  // 统一格式:{ appName1: data1, appName2: data2, ... }
38
38
  };
39
- m = false;
40
- E = /*#__PURE__*/function () {
41
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(a, o) {
42
- var h,
43
- i,
44
- p,
45
- O,
46
- b,
39
+ j = /*#__PURE__*/function () {
40
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(r, s) {
41
+ var $,
42
+ w,
43
+ u,
44
+ F,
47
45
  U,
48
- s,
46
+ k,
47
+ i,
49
48
  _args3 = arguments;
50
49
  return _regenerator().w(function (_context3) {
51
50
  while (1) switch (_context3.n) {
52
51
  case 0:
53
- h = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : "zh-CN";
54
- i = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : "资源";
55
- p = /*#__PURE__*/function () {
56
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(s) {
57
- var n, _t, _t2;
52
+ $ = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : "zh-CN";
53
+ w = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : "资源";
54
+ u = /*#__PURE__*/function () {
55
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(i) {
56
+ var o, _t, _t2;
58
57
  return _regenerator().w(function (_context) {
59
58
  while (1) switch (_context.p = _context.n) {
60
59
  case 0:
@@ -64,37 +63,37 @@ var _ = function _(u) {
64
63
  break;
65
64
  }
66
65
  _context.n = 1;
67
- return window.fetch(s, {
66
+ return window.fetch(i, {
68
67
  cache: "no-cache"
69
68
  });
70
69
  case 1:
71
- n = _context.v;
72
- if (!(!n || !n.ok)) {
70
+ o = _context.v;
71
+ if (!(!o || !o.ok)) {
73
72
  _context.n = 2;
74
73
  break;
75
74
  }
76
- _t = (console.warn("[fetchText] ".concat(i, " HTTP \u9519\u8BEF:"), n == null ? void 0 : n.status, n == null ? void 0 : n.statusText), null);
75
+ _t = null;
77
76
  _context.n = 4;
78
77
  break;
79
78
  case 2:
80
79
  _context.n = 3;
81
- return n.text();
80
+ return o.text();
82
81
  case 3:
83
82
  _t = _context.v;
84
83
  case 4:
85
84
  return _context.a(2, _t);
86
85
  case 5:
87
86
  _context.n = 6;
88
- return new Promise(function (n) {
87
+ return new Promise(function (o) {
89
88
  try {
90
89
  var t = new XMLHttpRequest();
91
- t.open("GET", s, !0), t.onreadystatechange = function () {
92
- t.readyState === 4 && n(t.status >= 200 && t.status < 300 ? t.responseText : null);
90
+ t.open("GET", i, !0), t.onreadystatechange = function () {
91
+ t.readyState === 4 && o(t.status >= 200 && t.status < 300 ? t.responseText : null);
93
92
  }, t.onerror = function () {
94
- n(null);
93
+ o(null);
95
94
  }, t.send();
96
95
  } catch (_unused) {
97
- n(null);
96
+ o(null);
98
97
  }
99
98
  });
100
99
  case 6:
@@ -111,106 +110,100 @@ var _ = function _(u) {
111
110
  }
112
111
  }, _callee, null, [[0, 8]]);
113
112
  }));
114
- return function p(_x4) {
113
+ return function u(_x4) {
115
114
  return _ref3.apply(this, arguments);
116
115
  };
117
116
  }();
118
- O = function O(s) {
119
- if (!s || typeof s != "string") return console.warn("[parseEsmDefault] 输入无效:", _typeof(s)), null;
120
- var t = s.replace(/^\uFEFF/, "").trim();
117
+ F = function F(i) {
118
+ if (!i || typeof i != "string") return null;
119
+ var t = i.replace(/^\uFEFF/, "").trim();
121
120
  if (t.startsWith("{")) try {
122
121
  var e = JSON.parse(t);
123
122
  if (e && _typeof(e) == "object") return e;
124
- } catch (e) {
125
- console.warn("[parseEsmDefault] JSON 解析失败:", e);
126
- }
127
- var j = t.match(/export\s+default\s*/);
128
- if (!j || j.index === undefined) return console.warn("[parseEsmDefault] 未找到 export default,且非纯 JSON 格式"), null;
123
+ } catch (_unused3) {}
124
+ var b = t.match(/export\s+default\s*/);
125
+ if (!b || b.index === undefined) return null;
129
126
  try {
130
- var _e = t.substring(j.index);
131
- 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) return console.warn("[parseEsmDefault] 清理后内容为空"), null;
127
+ var _e = t.substring(b.index);
128
+ 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) return null;
132
129
  try {
133
- var y = new Function("return ".concat(_e))();
134
- if (y && _typeof(y) == "object") return y;
135
- } catch (f) {
136
- console.warn("[parseEsmDefault] Function 构造器失败:", f);
137
- }
130
+ var d = new Function("return ".concat(_e))();
131
+ if (d && _typeof(d) == "object") return d;
132
+ } catch (_unused4) {}
138
133
  try {
139
- var f = _e.indexOf("{"),
140
- _y = _e.lastIndexOf("}");
141
- if (f === -1 || _y === -1 || _y <= f) return console.warn("[parseEsmDefault] JSON 解析:未找到对象结构"), null;
142
- var $ = _e.slice(f, _y + 1);
143
- $ = $.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/g, '$1"$2":'), $ = $.replace(/'([^'\\]*(\\.[^'\\]*)*)'/g, '"$1"'), $ = $.replace(/,\s*([}\]])/g, "$1");
144
- var x = JSON.parse($);
145
- if (x && _typeof(x) == "object") return x;
146
- } catch (f) {
147
- console.warn("[parseEsmDefault] JSON 解析失败:", f);
148
- }
134
+ var g = _e.indexOf("{"),
135
+ _d = _e.lastIndexOf("}");
136
+ if (g === -1 || _d === -1 || _d <= g) return null;
137
+ var p = _e.slice(g, _d + 1);
138
+ 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");
139
+ var E = JSON.parse(p);
140
+ if (E && _typeof(E) == "object") return E;
141
+ } catch (_unused5) {}
142
+ return null;
143
+ } catch (_unused6) {
149
144
  return null;
150
- } catch (e) {
151
- return console.error("[parseEsmDefault] 异常:", e), null;
152
145
  }
153
146
  };
154
- b = /*#__PURE__*/function () {
155
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(s) {
156
- var n, t;
147
+ U = /*#__PURE__*/function () {
148
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(i) {
149
+ var o, t;
157
150
  return _regenerator().w(function (_context2) {
158
151
  while (1) switch (_context2.n) {
159
152
  case 0:
160
- if (s) {
153
+ if (i) {
161
154
  _context2.n = 1;
162
155
  break;
163
156
  }
164
157
  return _context2.a(2, null);
165
158
  case 1:
166
159
  _context2.n = 2;
167
- return p(s);
160
+ return u(i);
168
161
  case 2:
169
- n = _context2.v;
170
- if (n) {
162
+ o = _context2.v;
163
+ if (o) {
171
164
  _context2.n = 3;
172
165
  break;
173
166
  }
174
- return _context2.a(2, (console.warn("[tryLoad] ".concat(i, " HTTP \u8BF7\u6C42\u5931\u8D25:"), s), null));
167
+ return _context2.a(2, null);
175
168
  case 3:
176
- t = O(n);
177
- return _context2.a(2, t !== null && _typeof(t) == "object" ? t : (console.warn("[tryLoad] ".concat(i, " \u89E3\u6790\u5931\u8D25:"), s), null));
169
+ t = F(o);
170
+ return _context2.a(2, t !== null && _typeof(t) == "object" ? t : null);
178
171
  }
179
172
  }, _callee2);
180
173
  }));
181
- return function b(_x5) {
174
+ return function U(_x5) {
182
175
  return _ref4.apply(this, arguments);
183
176
  };
184
177
  }();
185
178
  _context3.n = 1;
186
- return b(a);
179
+ return U(r);
187
180
  case 1:
188
- U = _context3.v;
189
- if (!U) {
181
+ k = _context3.v;
182
+ if (!k) {
190
183
  _context3.n = 2;
191
184
  break;
192
185
  }
193
- return _context3.a(2, U);
186
+ return _context3.a(2, k);
194
187
  case 2:
195
- if (!(console.warn("[loadWithFallback] ".concat(i, " - \u4E3B\u5730\u5740\u5931\u8D25\uFF0C\u5C1D\u8BD5\u56DE\u9000\u5730\u5740")), o && S(h))) {
188
+ if (!(s && z($))) {
196
189
  _context3.n = 4;
197
190
  break;
198
191
  }
199
192
  _context3.n = 3;
200
- return b(o);
193
+ return U(s);
201
194
  case 3:
202
- s = _context3.v;
203
- if (!s) {
195
+ i = _context3.v;
196
+ if (!i) {
204
197
  _context3.n = 4;
205
198
  break;
206
199
  }
207
- return _context3.a(2, (console.warn("[loadWithFallback] ".concat(i, " - \u56DE\u9000\u5730\u5740\u6210\u529F")), s));
200
+ return _context3.a(2, i);
208
201
  case 4:
209
- return _context3.a(2, (console.error("[loadWithFallback] ".concat(i, " - \u6240\u6709\u5730\u5740\u90FD\u5931\u8D25")), null));
202
+ return _context3.a(2, null);
210
203
  }
211
204
  }, _callee3);
212
205
  }));
213
- return function E(_x2, _x3) {
206
+ return function j(_x2, _x3) {
214
207
  return _ref2.apply(this, arguments);
215
208
  };
216
209
  }();
@@ -218,8 +211,8 @@ var _ = function _(u) {
218
211
  _context4.n = 9;
219
212
  break;
220
213
  }
221
- a = {};
222
- _iterator = _createForOfIteratorHelper(d);
214
+ r = {};
215
+ _iterator = _createForOfIteratorHelper(l);
223
216
  _context4.p = 1;
224
217
  _iterator.s();
225
218
  case 2:
@@ -227,14 +220,14 @@ var _ = function _(u) {
227
220
  _context4.n = 5;
228
221
  break;
229
222
  }
230
- o = _step.value;
231
- h = "".concat(l, "front-end/i18n/front-end-page/").concat(o, "_").concat(r, ".js");
232
- i = c ? "".concat(c, "front-end/i18n/front-end-page/").concat(o, "_").concat(r, ".js") : undefined;
223
+ s = _step.value;
224
+ $ = "".concat(c, "front-end/i18n/front-end-page/").concat(s, "_").concat(n, ".js");
225
+ w = a ? "".concat(a, "front-end/i18n/front-end-page/").concat(s, "_").concat(n, ".js") : undefined;
233
226
  _context4.n = 3;
234
- return E(h, i, r, "\u524D\u7AEF\u4E1A\u52A1\u8BED\u8A00\u8D44\u6E90(".concat(o, ")"));
227
+ return j($, w, n, "\u524D\u7AEF\u4E1A\u52A1\u8BED\u8A00\u8D44\u6E90(".concat(s, ")"));
235
228
  case 3:
236
- p = _context4.v;
237
- p && (a[o] = p, m = true);
229
+ u = _context4.v;
230
+ u && (r[s] = u, true);
238
231
  case 4:
239
232
  _context4.n = 2;
240
233
  break;
@@ -250,14 +243,14 @@ var _ = function _(u) {
250
243
  _iterator.f();
251
244
  return _context4.f(7);
252
245
  case 8:
253
- Object.keys(a).length > 0 && (w.frontEnd = a);
246
+ Object.keys(r).length > 0 && (y.frontEnd = r);
254
247
  case 9:
255
248
  if (!N) {
256
249
  _context4.n = 18;
257
250
  break;
258
251
  }
259
- _a = {};
260
- _iterator2 = _createForOfIteratorHelper(d);
252
+ _r = {};
253
+ _iterator2 = _createForOfIteratorHelper(l);
261
254
  _context4.p = 10;
262
255
  _iterator2.s();
263
256
  case 11:
@@ -265,14 +258,14 @@ var _ = function _(u) {
265
258
  _context4.n = 14;
266
259
  break;
267
260
  }
268
- _o = _step2.value;
269
- _h = "".concat(l, "front-end/i18n/return-msg/").concat(_o, "_").concat(r, ".js");
270
- _i = c ? "".concat(c, "front-end/i18n/return-msg/").concat(_o, "_").concat(r, ".js") : undefined;
261
+ _s = _step2.value;
262
+ _$ = "".concat(c, "front-end/i18n/return-msg/").concat(_s, "_").concat(n, ".js");
263
+ _w = a ? "".concat(a, "front-end/i18n/return-msg/").concat(_s, "_").concat(n, ".js") : undefined;
271
264
  _context4.n = 12;
272
- return E(_h, _i, r, "\u540E\u7AEF\u8BED\u8A00\u8D44\u6E90(".concat(_o, ")"));
265
+ return j(_$, _w, n, "\u540E\u7AEF\u8BED\u8A00\u8D44\u6E90(".concat(_s, ")"));
273
266
  case 12:
274
- _p = _context4.v;
275
- _p && (_a[_o] = _p, m = true);
267
+ _u = _context4.v;
268
+ _u && (_r[_s] = _u, true);
276
269
  case 13:
277
270
  _context4.n = 11;
278
271
  break;
@@ -288,27 +281,27 @@ var _ = function _(u) {
288
281
  _iterator2.f();
289
282
  return _context4.f(16);
290
283
  case 17:
291
- Object.keys(_a).length > 0 && (w.backMsg = _a);
284
+ Object.keys(_r).length > 0 && (y.backMsg = _r);
292
285
  case 18:
293
- if (!D) {
286
+ if (!O) {
294
287
  _context4.n = 20;
295
288
  break;
296
289
  }
297
- _a2 = "".concat(l, "front-end/i18n/front-end-page/dasui_").concat(r, ".js"), _o2 = c ? "".concat(c, "front-end/i18n/front-end-page/dasui_").concat(r, ".js") : undefined;
290
+ _r2 = "".concat(c, "front-end/i18n/front-end-page/dasui_").concat(n, ".js"), _s2 = a ? "".concat(a, "front-end/i18n/front-end-page/dasui_").concat(n, ".js") : undefined;
298
291
  _context4.n = 19;
299
- return E(_a2, _o2, r, "UI组件库语言资源");
292
+ return j(_r2, _s2, n, "UI组件库语言资源");
300
293
  case 19:
301
- w.dasUiEnd = _context4.v;
302
- w.dasUiEnd && (m = true);
294
+ y.dasUiEnd = _context4.v;
295
+ y.dasUiEnd && true;
303
296
  case 20:
304
- return _context4.a(2, (m || console.warn("语言包加载失败"), w));
297
+ return _context4.a(2, y);
305
298
  }
306
299
  }, _callee4, null, [[10, 15, 16, 17], [1, 6, 7, 8]]);
307
300
  }));
308
- return function z(_x) {
301
+ return function A(_x) {
309
302
  return _ref.apply(this, arguments);
310
303
  };
311
304
  }();
312
- exports.handleI18nData = z;
313
- exports.isCurrentLangInSysLang = S;
314
- exports.isEmpty = _;
305
+ exports.handleI18nData = A;
306
+ exports.isCurrentLangInSysLang = z;
307
+ exports.isEmpty = M;
@@ -1,22 +1,22 @@
1
- import { getConfig as F } from "@das-fed/upf-utils/config";
2
- const _ = (u) => u === null || typeof u > "u" || u === "", S = (u) => {
3
- var r;
4
- return (((r = F()) == null ? void 0 : r.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(u);
5
- }, z = async (u) => {
6
- const k = u || {};
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: r = "zh-CN",
9
- baseUrl: l = "/",
10
- appName: g = "jc",
8
+ currentLang: n = "zh-CN",
9
+ baseUrl: c = "/",
10
+ appName: h = "jc",
11
11
  isPullFrontEnd: L = !0,
12
12
  isPullBack: N = !1,
13
- isDasUI: D = !1,
14
- fallbackBaseUrl: c = ""
15
- } = k;
16
- (typeof r != "string" || !r) && (r = "zh-CN");
17
- let d = [];
18
- Array.isArray(g) ? (d = g.filter((a) => typeof a == "string" && a), d.length === 0 && (d = ["jc"])) : typeof g == "string" && g ? d = [g] : d = ["jc"], typeof l != "string" && (l = "/"), l || (l = "/"), l.endsWith("/") || (l = l + "/"), typeof c != "string" && (c = ""), c && !c.endsWith("/") && (c = c + "/");
19
- const w = {
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 E = async (a, o, h = "zh-CN", i = "资源") => {
28
- const p = async (s) => {
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 n = await window.fetch(s, { cache: "no-cache" });
32
- return !n || !n.ok ? (console.warn(`[fetchText] ${i} HTTP 错误:`, n == null ? void 0 : n.status, n == null ? void 0 : n.statusText), null) : await n.text();
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((n) => {
34
+ return await new Promise((o) => {
35
35
  try {
36
36
  const t = new XMLHttpRequest();
37
- t.open("GET", s, !0), t.onreadystatechange = function() {
38
- t.readyState === 4 && n(t.status >= 200 && t.status < 300 ? t.responseText : null);
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
- n(null);
40
+ o(null);
41
41
  }, t.send();
42
42
  } catch {
43
- n(null);
43
+ o(null);
44
44
  }
45
45
  });
46
46
  } catch {
47
47
  return null;
48
48
  }
49
- }, O = (s) => {
50
- if (!s || typeof s != "string")
51
- return console.warn("[parseEsmDefault] 输入无效:", typeof s), null;
52
- const t = s.replace(/^\uFEFF/, "").trim();
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 (e) {
59
- console.warn("[parseEsmDefault] 纯 JSON 解析失败:", e);
58
+ } catch {
60
59
  }
61
- const j = t.match(/export\s+default\s*/);
62
- if (!j || j.index === void 0)
63
- return console.warn("[parseEsmDefault] 未找到 export default,且非纯 JSON 格式"), null;
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(j.index);
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 console.warn("[parseEsmDefault] 清理后内容为空"), null;
66
+ return null;
68
67
  try {
69
- const y = new Function(`return ${e}`)();
70
- if (y && typeof y == "object")
71
- return y;
72
- } catch (f) {
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 f = e.indexOf("{"), y = e.lastIndexOf("}");
77
- if (f === -1 || y === -1 || y <= f)
78
- return console.warn("[parseEsmDefault] JSON 解析:未找到对象结构"), null;
79
- let $ = e.slice(f, y + 1);
80
- $ = $.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/g, '$1"$2":'), $ = $.replace(/'([^'\\]*(\\.[^'\\]*)*)'/g, '"$1"'), $ = $.replace(/,\s*([}\]])/g, "$1");
81
- const x = JSON.parse($);
82
- if (x && typeof x == "object")
83
- return x;
84
- } catch (f) {
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 (e) {
89
- return console.error("[parseEsmDefault] 异常:", e), null;
85
+ } catch {
86
+ return null;
90
87
  }
91
- }, b = async (s) => {
92
- if (!s) return null;
93
- const n = await p(s);
94
- if (!n)
95
- return console.warn(`[tryLoad] ${i} HTTP 请求失败:`, s), null;
96
- const t = O(n);
97
- return t !== null && typeof t == "object" ? t : (console.warn(`[tryLoad] ${i} 解析失败:`, s), null);
98
- }, U = await b(a);
99
- if (U)
100
- return U;
101
- if (console.warn(`[loadWithFallback] ${i} - 主地址失败,尝试回退地址`), o && S(h)) {
102
- const s = await b(o);
103
- if (s)
104
- return console.warn(`[loadWithFallback] ${i} - 回退地址成功`), s;
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 console.error(`[loadWithFallback] ${i} - 所有地址都失败`), null;
103
+ return null;
107
104
  };
108
105
  if (L) {
109
- const a = {};
110
- for (const o of d) {
111
- const h = `${l}front-end/i18n/front-end-page/${o}_${r}.js`, i = c ? `${c}front-end/i18n/front-end-page/${o}_${r}.js` : void 0, p = await E(
112
- h,
113
- i,
114
- r,
115
- `前端业务语言资源(${o})`
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
- p && (a[o] = p, m = !0);
114
+ u && (r[s] = u, m = !0);
118
115
  }
119
- Object.keys(a).length > 0 && (w.frontEnd = a);
116
+ Object.keys(r).length > 0 && (y.frontEnd = r);
120
117
  }
121
118
  if (N) {
122
- const a = {};
123
- for (const o of d) {
124
- const h = `${l}front-end/i18n/return-msg/${o}_${r}.js`, i = c ? `${c}front-end/i18n/return-msg/${o}_${r}.js` : void 0, p = await E(h, i, r, `后端语言资源(${o})`);
125
- p && (a[o] = p, m = !0);
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(a).length > 0 && (w.backMsg = a);
124
+ Object.keys(r).length > 0 && (y.backMsg = r);
128
125
  }
129
- if (D) {
130
- const a = `${l}front-end/i18n/front-end-page/dasui_${r}.js`, o = c ? `${c}front-end/i18n/front-end-page/dasui_${r}.js` : void 0;
131
- w.dasUiEnd = await E(a, o, r, "UI组件库语言资源"), w.dasUiEnd && (m = !0);
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 m || console.warn("语言包加载失败"), w;
130
+ return y;
134
131
  };
135
132
  export {
136
- z as handleI18nData,
137
- S as isCurrentLangInSysLang,
138
- _ as isEmpty
133
+ A as handleI18nData,
134
+ z as isCurrentLangInSysLang,
135
+ M as isEmpty
139
136
  };