ztxkutils 2.7.5 → 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.
Files changed (2) hide show
  1. package/dist/stompClient.js +21 -17
  2. package/package.json +1 -1
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkutils",
3
- "version": "2.7.5",
3
+ "version": "2.7.6",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",