ztxkutils 2.7.7 → 2.7.8

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-685af55f.js';
4
+ export { a as default } from './request-5b825e2e.js';
5
5
  import './authority-fad2028d.js';
6
6
  import './crypto-c481f616.js';
7
7
  import 'crypto';
@@ -24,6 +24,7 @@ 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.isClient = false;
27
28
  if (this.clearIsClient) {
28
29
  clearTimeout(this.clearIsClient);
29
30
  this.clearIsClient = null;
@@ -31,19 +32,19 @@ var StompClient = /** @class */ (function () {
31
32
  if (!_this.isClient) {
32
33
  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
34
  _this.client.disconnect(function () {
34
- _this.client = null;
35
- _this.reconnectionNum++;
36
35
  // const timeInterval =
37
36
  // Math.ceil(this.reconnectionNum / 5) *
38
37
  // (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
38
  });
39
+ _this.client = null;
40
+ _this.reconnectionNum++;
41
+ var timeInterval = 3000;
42
+ console.log("\u7B2C" + _this.reconnectionNum + "\u6B21\u91CD\u8FDE\uFF01");
43
+ setTimeout(function () {
44
+ _this.init();
45
+ }, timeInterval > 10000 ? 10000 : timeInterval);
45
46
  }
46
- }, 10000);
47
+ }, 20000);
47
48
  }
48
49
  // 拦截输出的一大堆垃圾信息
49
50
  this.client.debug = function (str) {
@@ -62,6 +63,7 @@ var StompClient = /** @class */ (function () {
62
63
  _this.isClient = true;
63
64
  if (_this.clearIsClient) {
64
65
  clearTimeout(_this.clearIsClient);
66
+ _this.clearIsClient = null;
65
67
  }
66
68
  _this.reconnectionNum = 0;
67
69
  console.log('---------连接成功--------');
@@ -102,6 +104,7 @@ var StompClient = /** @class */ (function () {
102
104
  _this.isClient = true;
103
105
  if (_this.clearIsClient) {
104
106
  clearTimeout(_this.clearIsClient);
107
+ _this.clearIsClient = null;
105
108
  }
106
109
  // this.errorCallback(err);
107
110
  // 连接失败后,将当前已注册的 连接通道 全部置为未执行状态
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkutils",
3
- "version": "2.7.7",
3
+ "version": "2.7.8",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",