ztxkutils 2.10.66-27 → 2.10.66-28

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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { d as authority } from './authority-7a91cb9f.js';
2
2
  export { d as dataModel } from './dataModel-6c68c88f.js';
3
3
  export { t as tools } from './tools-390e3466.js';
4
- export { v as validate } from './validate-21164759.js';
4
+ export { v as validate } from './validate-4e0272c6.js';
5
5
  export { r as request } from './request-d8d72b87.js';
6
6
  export { r as reqUrl } from './reqUrl-ea7ef876.js';
7
7
  import './i18next.js';
@@ -2470,7 +2470,7 @@ var AxiosCancel = /** @class */ (function () {
2470
2470
  }());
2471
2471
  var axiosCancel = new AxiosCancel();
2472
2472
 
2473
- var timeoutNum = 60000 * 5;
2473
+ var timeoutNum = 60000;
2474
2474
  var isRefreshing = true; // 是否需要刷新
2475
2475
  var subscribers = []; // 缓存需要帮助请求的接口
2476
2476
  var requestTokenEndTime = 0; // token调用结束时间
@@ -2806,10 +2806,6 @@ function request(myOptions, jumpCallback, otherOptions) {
2806
2806
  }
2807
2807
  // 将传入配置与默认配置混合
2808
2808
  var newOptions = __assign(__assign(__assign({}, defaultOptions), options), { headers: __assign(__assign({}, defaultOptions.headers), options.headers) });
2809
- // 湘钢国贸项目 除了登录接口外 去掉 Authorization认证头部
2810
- if (newOptions.url !== '/api/zmdms-auth/oauth/token' && !InnerAuthorization) {
2811
- delete newOptions.headers.Authorization;
2812
- }
2813
2809
  // 特殊请求处理
2814
2810
  if (((_e = newOptions.method) === null || _e === void 0 ? void 0 : _e.toUpperCase()) === 'POST' ||
2815
2811
  ((_f = newOptions.method) === null || _f === void 0 ? void 0 : _f.toUpperCase()) === 'PUT' ||
@@ -1,5 +1,4 @@
1
1
  import { a as __rest, _ as __assign } from './tslib.es6-35653116.js';
2
- import instance from './i18next.js';
3
2
  import axios from 'axios';
4
3
  import { Modal, message } from 'ztxkui';
5
4
  import { c as commonjsGlobal, a as crypto } from './crypto-c481f616.js';
@@ -2453,7 +2452,7 @@ var AxiosCancel = /** @class */ (function () {
2453
2452
  // 将token挂载到当前接口的请求头里面
2454
2453
  config.cancelToken = cancelTokenObj.token;
2455
2454
  if (this.pendingRequests.has(key)) {
2456
- this.pendingRequests.get(key).cancel(instance.t('拦截重复请求'));
2455
+ this.pendingRequests.get(key).cancel('拦截重复请求');
2457
2456
  this.pendingRequests.delete(key);
2458
2457
  }
2459
2458
  this.pendingRequests.set(key, {
@@ -2513,7 +2512,7 @@ function checkStatus(response, jumpCallback, otherOptions) {
2513
2512
  refreshTokenRequst(jumpCallback, InnerAuthorization);
2514
2513
  }
2515
2514
  else {
2516
- message.info(instance.t('刷新token遭到频繁调用,请联系管理员查看是否接口权限出现问题,可能是{{slot0}}接口出现问题', { slot0: response === null || response === void 0 ? void 0 : response.config.url }), 5);
2515
+ message.info("\u5237\u65B0token\u906D\u5230\u9891\u7E41\u8C03\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u67E5\u770B\u662F\u5426\u63A5\u53E3\u6743\u9650\u51FA\u73B0\u95EE\u9898\uFF0C\u53EF\u80FD\u662F" + (response === null || response === void 0 ? void 0 : response.config.url) + "\u63A5\u53E3\u51FA\u73B0\u95EE\u9898", 5);
2517
2516
  requestTokenEndTime = 0;
2518
2517
  }
2519
2518
  }
@@ -2561,7 +2560,6 @@ function refreshTokenRequst(jumpCallback, Authorization) {
2561
2560
  // 刷新成功 重置token 重置refresh-token
2562
2561
  setToken(data === null || data === void 0 ? void 0 : data.access_token);
2563
2562
  setRefreshToken(data === null || data === void 0 ? void 0 : data.refresh_token);
2564
- message.info(instance.t('token已经刷新成功,请重新提交!', {}));
2565
2563
  onAccessTokenFetched();
2566
2564
  isRefreshing = true;
2567
2565
  }
@@ -2575,7 +2573,7 @@ function refreshTokenRequst(jumpCallback, Authorization) {
2575
2573
  jumpCallback(401);
2576
2574
  }
2577
2575
  else {
2578
- message.info(instance.t('登录过期!', {}), 3.5, function () {
2576
+ message.info("\u767B\u5F55\u8FC7\u671F\uFF01", 3.5, function () {
2579
2577
  isExpiration = false;
2580
2578
  });
2581
2579
  window.location.href = '/login';
@@ -2591,7 +2589,7 @@ function refreshTokenRequst(jumpCallback, Authorization) {
2591
2589
  jumpCallback(401);
2592
2590
  }
2593
2591
  else {
2594
- message.info(instance.t('登录过期!', {}), 3.5, function () {
2592
+ message.info("\u767B\u5F55\u8FC7\u671F\uFF01", 3.5, function () {
2595
2593
  isExpiration = false;
2596
2594
  });
2597
2595
  window.location.href = '/login';
@@ -2667,11 +2665,7 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
2667
2665
  __isTimeoutMessage) {
2668
2666
  isMessage = true;
2669
2667
  Modal.confirm({
2670
- title: instance.t('请求超时,请稍后再试,请去列表确认数据是否插入成功,请勿重复提交! 接口地址:{{slot0}} 请求方式:{{slot1}} 请求超时时间:{{slot2}}', {
2671
- slot0: (_d = error === null || error === void 0 ? void 0 : error.config) === null || _d === void 0 ? void 0 : _d.url,
2672
- slot1: (_e = error === null || error === void 0 ? void 0 : error.config) === null || _e === void 0 ? void 0 : _e.method,
2673
- slot2: (_f = error === null || error === void 0 ? void 0 : error.config) === null || _f === void 0 ? void 0 : _f.timeout,
2674
- }),
2668
+ 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),
2675
2669
  okCancel: false,
2676
2670
  onOk: function () {
2677
2671
  isMessage = false;
@@ -2685,7 +2679,7 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
2685
2679
  if ((errRes === null || errRes === void 0 ? void 0 : errRes.status) === 404) {
2686
2680
  if (!isNotFound) {
2687
2681
  isNotFound = true;
2688
- message.info(instance.t('接口: {{slot0}} 未找到!', { slot0: errRes.config.url }), 3.5, function () {
2682
+ message.info("\u63A5\u53E3: " + errRes.config.url + " \u672A\u627E\u5230\uFF01", 3.5, function () {
2689
2683
  isNotFound = false;
2690
2684
  });
2691
2685
  }
@@ -2701,7 +2695,7 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
2701
2695
  jumpCallback(errRes === null || errRes === void 0 ? void 0 : errRes.status);
2702
2696
  }
2703
2697
  else {
2704
- message.info(instance.t('你的账号已在其他地方登录!', {}), 3.5, function () {
2698
+ message.info("\u4F60\u7684\u8D26\u53F7\u5DF2\u5728\u5176\u4ED6\u5730\u65B9\u767B\u5F55\uFF01", 3.5, function () {
2705
2699
  isOffSite = false;
2706
2700
  });
2707
2701
  window.location.href = '/login';
@@ -2719,7 +2713,7 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
2719
2713
  jumpCallback(errRes === null || errRes === void 0 ? void 0 : errRes.status);
2720
2714
  }
2721
2715
  else {
2722
- message.info(instance.t('登录过期!', {}), 3.5, function () {
2716
+ message.info("\u767B\u5F55\u8FC7\u671F\uFF01", 3.5, function () {
2723
2717
  isExpiration = false;
2724
2718
  });
2725
2719
  window.location.href = '/login';