ztxkutils 2.7.3 → 2.7.6

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/request.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import './tslib.es6-f9459658.js';
2
2
  import 'axios';
3
3
  import 'ztxkui';
4
- export { a as default } from './request-90475df7.js';
4
+ export { a as default } from './request-35b10c4f.js';
5
5
  import './authority-fad2028d.js';
6
6
  import './crypto-c481f616.js';
7
7
  import 'crypto';
@@ -24,23 +24,27 @@ var StompClient = /** @class */ (function () {
24
24
  var socket = new SockJS(this.connectWsConfig.baseUrl + "/api/zmdms-csc-ztim/ws?token=" + token + "&system=" + this.connectWsConfig.systemType + "&clientType=" + this.connectWsConfig.clientType);
25
25
  // 获取 STOMP 子协议的客户端对象
26
26
  this.client = Stomp.over(socket);
27
- this.clearIsClient = setTimeout(function () {
28
- if (!_this.isClient) {
29
- console.log("\u8FDE\u63A5\u5DF2\u53D1\u8D77\uFF0C\u4F46\u662F10\u79D2\u540E\u672A\u6210\u529F\u5EFA\u7ACB\u8FDE\u63A5\uFF0C\u624B\u52A8\u65AD\u5F00\u91CD\u8FDE!");
30
- _this.client.disconnect(function () {
31
- _this.client = null;
32
- _this.reconnectionNum++;
33
- // const timeInterval =
34
- // Math.ceil(this.reconnectionNum / 5) *
35
- // (this.connectWsConfig.reconnectionTime ?? 3000);
36
- var timeInterval = 3000;
37
- console.log("\u7B2C" + _this.reconnectionNum + "\u6B21\u91CD\u8FDE\uFF01");
38
- setTimeout(function () {
39
- _this.init();
40
- }, timeInterval);
41
- });
42
- }
43
- }, 10000);
27
+ if (this.clearIsClient) {
28
+ clearTimeout(this.clearIsClient);
29
+ this.clearIsClient = null;
30
+ this.clearIsClient = setTimeout(function () {
31
+ if (!_this.isClient) {
32
+ console.log("\u8FDE\u63A5\u5DF2\u53D1\u8D77\uFF0C\u4F46\u662F10\u79D2\u540E\u672A\u6210\u529F\u5EFA\u7ACB\u8FDE\u63A5\uFF0C\u624B\u52A8\u65AD\u5F00\u91CD\u8FDE!");
33
+ _this.client.disconnect(function () {
34
+ _this.client = null;
35
+ _this.reconnectionNum++;
36
+ // const timeInterval =
37
+ // Math.ceil(this.reconnectionNum / 5) *
38
+ // (this.connectWsConfig.reconnectionTime ?? 3000);
39
+ var timeInterval = 3000;
40
+ console.log("\u7B2C" + _this.reconnectionNum + "\u6B21\u91CD\u8FDE\uFF01");
41
+ setTimeout(function () {
42
+ _this.init();
43
+ }, timeInterval);
44
+ });
45
+ }
46
+ }, 10000);
47
+ }
44
48
  // 拦截输出的一大堆垃圾信息
45
49
  this.client.debug = function (str) {
46
50
  if (_this.connectWsConfig.debug) {
@@ -128,18 +132,16 @@ var StompClient = /** @class */ (function () {
128
132
  // 重连逻辑, 默认3秒后重连
129
133
  // 重连间隔,每隔5秒递增,超过最大间隔时间后,取最大间隔时间重连
130
134
  _this.client.disconnect(function () {
135
+ _this.client = null;
136
+ _this.reconnectionNum++;
137
+ // const timeInterval =
138
+ // Math.ceil(this.reconnectionNum / 5) *
139
+ // (this.connectWsConfig.reconnectionTime ?? 3000);
140
+ var timeInterval = 3000;
141
+ console.log("\u7B2C" + _this.reconnectionNum + "\u6B21\u91CD\u8FDE\uFF01");
131
142
  setTimeout(function () {
132
- _this.client = null;
133
- _this.reconnectionNum++;
134
- // const timeInterval =
135
- // Math.ceil(this.reconnectionNum / 5) *
136
- // (this.connectWsConfig.reconnectionTime ?? 3000);
137
- var timeInterval = 3000;
138
- console.log("\u7B2C" + _this.reconnectionNum + "\u6B21\u91CD\u8FDE\uFF01");
139
- setTimeout(function () {
140
- _this.init();
141
- }, timeInterval);
142
- }, 300);
143
+ _this.init();
144
+ }, timeInterval);
143
145
  });
144
146
  });
145
147
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkutils",
3
- "version": "2.7.3",
3
+ "version": "2.7.6",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",