ztxkutils 2.10.66-2 → 2.10.66-20

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 (89) hide show
  1. package/dist/authority-e6bde99f.js +423 -0
  2. package/dist/fileOperation.d.ts +19 -0
  3. package/dist/fileOperation.js +58 -16
  4. package/dist/i18next.d.ts +2 -0
  5. package/dist/i18next.js +2380 -0
  6. package/dist/index.js +2 -2
  7. package/dist/reqUrl-3792afcd.js +82 -0
  8. package/dist/reqUrl-787dd9e5.js +82 -0
  9. package/dist/reqUrl-ea7ef876.js +83 -0
  10. package/dist/reqUrl.js +1 -1
  11. package/dist/request-0cc024b1.js +2917 -0
  12. package/dist/{request-dc69f021.js → request-4c29d6de.js} +14 -9
  13. package/dist/request-ba8abf99.js +2902 -0
  14. package/dist/request-ef290b9a.js +2838 -0
  15. package/dist/request.js +1 -1
  16. package/dist/tools-09a4d620.js +2445 -0
  17. package/dist/tools-0ca888cd.js +2473 -0
  18. package/dist/validate-6e735536.js +79 -0
  19. package/dist/zti18n-cli/bin/index.d.ts +2 -0
  20. package/dist/zti18n-cli/index.d.ts +1 -0
  21. package/dist/zti18n-cli/src/command/collect.d.ts +2 -0
  22. package/dist/zti18n-cli/src/command/convert.d.ts +2 -0
  23. package/dist/zti18n-cli/src/command/convert2.d.ts +2 -0
  24. package/dist/zti18n-cli/src/command/initFileConf.d.ts +2 -0
  25. package/dist/zti18n-cli/src/command/publish.d.ts +2 -0
  26. package/dist/zti18n-cli/src/conf/BaseConf.d.ts +8 -0
  27. package/dist/zti18n-cli/src/conf/FileConf.d.ts +6 -0
  28. package/dist/zti18n-cli/src/index.d.ts +1 -0
  29. package/dist/zti18n-cli/src/translate/google.d.ts +2 -0
  30. package/dist/zti18n-cli/src/utils/isChinese.d.ts +2 -0
  31. package/dist/zti18n-cli/src/utils/log.d.ts +4 -0
  32. package/dist/zti18n-cli/src/utils/mergeOptions.d.ts +24 -0
  33. package/dist/zti18n-cli/src/utils/reactOptions.d.ts +21 -0
  34. package/dist/zti18n-cli/src/utils/vueOptions.d.ts +17 -0
  35. package/dist/zti18n-core/index.d.ts +2 -0
  36. package/dist/zti18n-core/src/index.d.ts +8 -0
  37. package/dist/zti18n-core/src/plugin/reactIntlToReactIntlUniversal.d.ts +19 -0
  38. package/dist/zti18n-core/src/plugin/reactIntlUniversalToDi18n.d.ts +9 -0
  39. package/dist/zti18n-core/src/transform/defaultPkMap.d.ts +75 -0
  40. package/dist/zti18n-core/src/transform/transformHtml.d.ts +5 -0
  41. package/dist/zti18n-core/src/transform/transformJs.d.ts +5 -0
  42. package/dist/zti18n-core/src/transform/transformPug.d.ts +5 -0
  43. package/dist/zti18n-core/src/transform/transformReactIntlToReactIntlUniversal.d.ts +2 -0
  44. package/dist/zti18n-core/src/transform/transformReactIntlUniveralToDi18n.d.ts +2 -0
  45. package/dist/zti18n-core/src/transform/transformToDi18n.d.ts +5 -0
  46. package/dist/zti18n-core/src/transform/transformTs.d.ts +5 -0
  47. package/dist/zti18n-core/src/transform/transformVue.d.ts +5 -0
  48. package/dist/zti18n-core/src/transform/transformZeroToDi18n.d.ts +2 -0
  49. package/dist/zti18n-core/src/translate/google.d.ts +2 -0
  50. package/dist/zti18n-core/src/utils/constants.d.ts +3 -0
  51. package/dist/zti18n-core/src/utils/getIgnoreLines.d.ts +2 -0
  52. package/dist/zti18n-core/src/utils/isChinese.d.ts +2 -0
  53. package/dist/zti18n-core/src/utils/log.d.ts +4 -0
  54. package/package.json +41 -4
  55. package/zti18n-cli/bin/index.js +3 -0
  56. package/zti18n-cli/index.js +23 -0
  57. package/zti18n-cli/src/command/collect.js +351 -0
  58. package/zti18n-cli/src/command/convert.js +17 -0
  59. package/zti18n-cli/src/command/convert2.js +35 -0
  60. package/zti18n-cli/src/command/initFileConf.js +133 -0
  61. package/zti18n-cli/src/command/publish.js +24 -0
  62. package/zti18n-cli/src/conf/BaseConf.js +21 -0
  63. package/zti18n-cli/src/conf/FileConf.js +116 -0
  64. package/zti18n-cli/src/index.js +75 -0
  65. package/zti18n-cli/src/translate/google.js +6 -0
  66. package/zti18n-cli/src/utils/isChinese.js +3 -0
  67. package/zti18n-cli/src/utils/log.js +8 -0
  68. package/zti18n-cli/src/utils/mergeOptions.js +45 -0
  69. package/zti18n-cli/src/utils/reactOptions.js +73 -0
  70. package/zti18n-cli/src/utils/vueOptions.js +69 -0
  71. package/zti18n-core/index.js +1 -0
  72. package/zti18n-core/src/index.js +5 -0
  73. package/zti18n-core/src/plugin/reactIntlToReactIntlUniversal.js +224 -0
  74. package/zti18n-core/src/plugin/reactIntlUniversalToDi18n.js +64 -0
  75. package/zti18n-core/src/transform/defaultPkMap.js +79 -0
  76. package/zti18n-core/src/transform/transformHtml.js +271 -0
  77. package/zti18n-core/src/transform/transformJs.js +488 -0
  78. package/zti18n-core/src/transform/transformPug.js +272 -0
  79. package/zti18n-core/src/transform/transformReactIntlToReactIntlUniversal.js +96 -0
  80. package/zti18n-core/src/transform/transformReactIntlUniveralToDi18n.js +90 -0
  81. package/zti18n-core/src/transform/transformToDi18n.js +22 -0
  82. package/zti18n-core/src/transform/transformTs.js +41 -0
  83. package/zti18n-core/src/transform/transformVue.js +126 -0
  84. package/zti18n-core/src/transform/transformZeroToDi18n.js +105 -0
  85. package/zti18n-core/src/translate/google.js +6 -0
  86. package/zti18n-core/src/utils/constants.js +3 -0
  87. package/zti18n-core/src/utils/getIgnoreLines.js +14 -0
  88. package/zti18n-core/src/utils/isChinese.js +3 -0
  89. package/zti18n-core/src/utils/log.js +8 -0
@@ -2560,6 +2560,7 @@ function refreshTokenRequst(jumpCallback, Authorization) {
2560
2560
  // 刷新成功 重置token 重置refresh-token
2561
2561
  setToken(data === null || data === void 0 ? void 0 : data.access_token);
2562
2562
  setRefreshToken(data === null || data === void 0 ? void 0 : data.refresh_token);
2563
+ message.info("token\u5DF2\u7ECF\u5237\u65B0\u6210\u529F\uFF0C\u8BF7\u91CD\u65B0\u63D0\u4EA4\uFF01");
2563
2564
  onAccessTokenFetched();
2564
2565
  isRefreshing = true;
2565
2566
  }
@@ -2634,7 +2635,7 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
2634
2635
  return Promise.reject(response);
2635
2636
  }
2636
2637
  }, function (error) {
2637
- var _a, _b, _c, _d, _e;
2638
+ var _a, _b, _c, _d, _e, _f;
2638
2639
  // catchPromiseObj = [];
2639
2640
  console.error(error);
2640
2641
  var errRes = error === null || error === void 0 ? void 0 : error.response;
@@ -2649,8 +2650,9 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
2649
2650
  });
2650
2651
  });
2651
2652
  /** 如果接口出错了,清理掉这个错误的接口缓存 */
2652
- if (autonomousCatchingPromiseObj[error === null || error === void 0 ? void 0 : error.config.url]) {
2653
- autonomousCatchingPromiseObj[error === null || error === void 0 ? void 0 : error.config.url] = undefined;
2653
+ var autonomousCatchingKey = ((_a = error === null || error === void 0 ? void 0 : error.config) === null || _a === void 0 ? void 0 : _a.autonomousKey) || (error === null || error === void 0 ? void 0 : error.config.url);
2654
+ if (autonomousCatchingPromiseObj[autonomousCatchingKey]) {
2655
+ autonomousCatchingPromiseObj[autonomousCatchingKey] = undefined;
2654
2656
  }
2655
2657
  if (item !== -1) {
2656
2658
  catchPromiseObj.splice(item, 1);
@@ -2660,11 +2662,11 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
2660
2662
  // 超时异常统一处理,超时的异常没有response值,只能通过toString处理
2661
2663
  if (!errRes && error.toString().indexOf(timeoutNum + "ms") !== -1) {
2662
2664
  if (!isMessage) {
2663
- if (((_b = (_a = error === null || error === void 0 ? void 0 : error.config) === null || _a === void 0 ? void 0 : _a.method) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === 'POST' &&
2665
+ if (((_c = (_b = error === null || error === void 0 ? void 0 : error.config) === null || _b === void 0 ? void 0 : _b.method) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === 'POST' &&
2664
2666
  __isTimeoutMessage) {
2665
2667
  isMessage = true;
2666
2668
  Modal.confirm({
2667
- title: "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\uFF0C\u8BF7\u53BB\u5217\u8868\u786E\u8BA4\u6570\u636E\u662F\u5426\u63D2\u5165\u6210\u529F\uFF0C\u8BF7\u52FF\u91CD\u590D\u63D0\u4EA4\uFF01\n\u63A5\u53E3\u5730\u5740:" + ((_c = error === null || error === void 0 ? void 0 : error.config) === null || _c === void 0 ? void 0 : _c.url) + "\n\u8BF7\u6C42\u65B9\u5F0F:" + ((_d = error === null || error === void 0 ? void 0 : error.config) === null || _d === void 0 ? void 0 : _d.method) + "\n\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4:" + ((_e = error === null || error === void 0 ? void 0 : error.config) === null || _e === void 0 ? void 0 : _e.timeout),
2669
+ title: "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\uFF0C\u8BF7\u53BB\u5217\u8868\u786E\u8BA4\u6570\u636E\u662F\u5426\u63D2\u5165\u6210\u529F\uFF0C\u8BF7\u52FF\u91CD\u590D\u63D0\u4EA4\uFF01\n\u63A5\u53E3\u5730\u5740:" + ((_d = error === null || error === void 0 ? void 0 : error.config) === null || _d === void 0 ? void 0 : _d.url) + "\n\u8BF7\u6C42\u65B9\u5F0F:" + ((_e = error === null || error === void 0 ? void 0 : error.config) === null || _e === void 0 ? void 0 : _e.method) + "\n\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4:" + ((_f = error === null || error === void 0 ? void 0 : error.config) === null || _f === void 0 ? void 0 : _f.timeout),
2668
2670
  okCancel: false,
2669
2671
  onOk: function () {
2670
2672
  isMessage = false;
@@ -2778,7 +2780,7 @@ function request(myOptions, jumpCallback, otherOptions) {
2778
2780
  setInterceptorsResponse(jumpCallback, otherOptions);
2779
2781
  isFirstSet = true;
2780
2782
  }
2781
- var encryptionType = myOptions.encryptionType, isTimeoutMessage = myOptions.isTimeoutMessage, isForceRequest = myOptions.isForceRequest, _m = myOptions.noCatchUrl, noCatchUrl = _m === void 0 ? [] : _m, isCatch = myOptions.isCatch, mustCatch = myOptions.mustCatch, isAutonomousCatch = myOptions.isAutonomousCatch, _o = myOptions.autonomousCount, autonomousCount = _o === void 0 ? 1 : _o, options = __rest(myOptions, ["encryptionType", "isTimeoutMessage", "isForceRequest", "noCatchUrl", "isCatch", "mustCatch", "isAutonomousCatch", "autonomousCount"]);
2783
+ var encryptionType = myOptions.encryptionType, isTimeoutMessage = myOptions.isTimeoutMessage, isForceRequest = myOptions.isForceRequest, _m = myOptions.noCatchUrl, noCatchUrl = _m === void 0 ? [] : _m, isCatch = myOptions.isCatch, mustCatch = myOptions.mustCatch, isAutonomousCatch = myOptions.isAutonomousCatch, _o = myOptions.autonomousCount, autonomousCount = _o === void 0 ? 1 : _o, autonomousKey = myOptions.autonomousKey, options = __rest(myOptions, ["encryptionType", "isTimeoutMessage", "isForceRequest", "noCatchUrl", "isCatch", "mustCatch", "isAutonomousCatch", "autonomousCount", "autonomousKey"]);
2782
2784
  timeoutNum =
2783
2785
  typeof myOptions.timeout === 'number' ? myOptions.timeout : timeoutNum;
2784
2786
  __isTimeoutMessage = isTimeoutMessage;
@@ -2792,6 +2794,8 @@ function request(myOptions, jumpCallback, otherOptions) {
2792
2794
  'Zmdms-Auth': "bearer " + token,
2793
2795
  'Tenant-Id': '000000',
2794
2796
  Authorization: InnerAuthorization ? InnerAuthorization : Authorization,
2797
+ // 设置语言包请求头
2798
+ 'Zmdms-Lang': window.localStorage.getItem('languageType') || 'zh_CN',
2795
2799
  },
2796
2800
  };
2797
2801
  if ((_a = options.baseURL) === null || _a === void 0 ? void 0 : _a.endsWith('/')) {
@@ -2810,7 +2814,7 @@ function request(myOptions, jumpCallback, otherOptions) {
2810
2814
  options.params = transformObj(options.params);
2811
2815
  }
2812
2816
  // 将传入配置与默认配置混合
2813
- var newOptions = __assign(__assign(__assign({}, defaultOptions), options), { headers: __assign(__assign({}, defaultOptions.headers), options.headers) });
2817
+ var newOptions = __assign(__assign(__assign({}, defaultOptions), options), { autonomousKey: autonomousKey, headers: __assign(__assign({}, defaultOptions.headers), options.headers) });
2814
2818
  // 特殊请求处理
2815
2819
  if (((_e = newOptions.method) === null || _e === void 0 ? void 0 : _e.toUpperCase()) === 'POST' ||
2816
2820
  ((_f = newOptions.method) === null || _f === void 0 ? void 0 : _f.toUpperCase()) === 'PUT' ||
@@ -2856,11 +2860,12 @@ function request(myOptions, jumpCallback, otherOptions) {
2856
2860
  }
2857
2861
  // 自主缓存请求。默认这个缓存只会针对一个url缓存一次请求
2858
2862
  if (isAutonomousCatch) {
2859
- var item = autonomousCatchingPromiseObj[newOptions.url];
2863
+ var autonomousCatchingKey = autonomousKey || newOptions.url;
2864
+ var item = autonomousCatchingPromiseObj[autonomousCatchingKey];
2860
2865
  // 如果当前接口没有缓存 缓存住,并且返回接口结果
2861
2866
  if (!item || !Array.isArray(item)) {
2862
2867
  var result = axios(newOptions);
2863
- autonomousCatchingPromiseObj[newOptions.url] = [
2868
+ autonomousCatchingPromiseObj[autonomousCatchingKey] = [
2864
2869
  {
2865
2870
  params: newOptions.params,
2866
2871
  promiseObj: result,