ztxkutils 2.7.7 → 2.7.10
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 +1 -1
- package/dist/request-5b825e2e.js +2742 -0
- package/dist/request.js +1 -1
- package/dist/stompClient.js +25 -13
- package/package.json +1 -1
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-
|
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';
|
package/dist/stompClient.js
CHANGED
@@ -24,26 +24,36 @@ 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;
|
28
|
+
// 如果存在 证明已经初始化过,直接删除
|
27
29
|
if (this.clearIsClient) {
|
28
30
|
clearTimeout(this.clearIsClient);
|
29
31
|
this.clearIsClient = null;
|
32
|
+
}
|
33
|
+
if (!this.clearIsClient) {
|
30
34
|
this.clearIsClient = setTimeout(function () {
|
35
|
+
_this.clearIsClient = null;
|
31
36
|
if (!_this.isClient) {
|
32
37
|
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
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
38
|
+
try {
|
39
|
+
_this.client.disconnect(function () {
|
40
|
+
// const timeInterval =
|
41
|
+
// Math.ceil(this.reconnectionNum / 5) *
|
42
|
+
// (this.connectWsConfig.reconnectionTime ?? 3000);
|
43
|
+
});
|
44
|
+
}
|
45
|
+
catch (err) {
|
46
|
+
console.log('---关闭出错---', err);
|
47
|
+
}
|
48
|
+
_this.client = null;
|
49
|
+
_this.reconnectionNum++;
|
50
|
+
var timeInterval = 3000;
|
51
|
+
console.log("\u7B2C" + _this.reconnectionNum + "\u6B21\u91CD\u8FDE\uFF01");
|
52
|
+
setTimeout(function () {
|
53
|
+
_this.init();
|
54
|
+
}, timeInterval > 10000 ? 10000 : timeInterval);
|
45
55
|
}
|
46
|
-
},
|
56
|
+
}, 20000);
|
47
57
|
}
|
48
58
|
// 拦截输出的一大堆垃圾信息
|
49
59
|
this.client.debug = function (str) {
|
@@ -62,6 +72,7 @@ var StompClient = /** @class */ (function () {
|
|
62
72
|
_this.isClient = true;
|
63
73
|
if (_this.clearIsClient) {
|
64
74
|
clearTimeout(_this.clearIsClient);
|
75
|
+
_this.clearIsClient = null;
|
65
76
|
}
|
66
77
|
_this.reconnectionNum = 0;
|
67
78
|
console.log('---------连接成功--------');
|
@@ -102,6 +113,7 @@ var StompClient = /** @class */ (function () {
|
|
102
113
|
_this.isClient = true;
|
103
114
|
if (_this.clearIsClient) {
|
104
115
|
clearTimeout(_this.clearIsClient);
|
116
|
+
_this.clearIsClient = null;
|
105
117
|
}
|
106
118
|
// this.errorCallback(err);
|
107
119
|
// 连接失败后,将当前已注册的 连接通道 全部置为未执行状态
|