|
|
@@ -268,22 +268,21 @@ export default {
|
|
|
const self = this
|
|
|
self.timeoutObj && clearTimeout(self.timeoutObj)
|
|
|
self.serverTimeoutObj && clearTimeout(self.serverTimeoutObj)
|
|
|
- self.timeoutObj = setTimeout(function () {
|
|
|
- // 这里发送一个心跳,后端收到后,返回一个心跳消息,
|
|
|
- console.log(self.websock)
|
|
|
- if (self.websock.readyState === 1) {
|
|
|
- // 如果连接正常
|
|
|
- self.websock.send('heartCheck') // 这里可以自己跟后端约定
|
|
|
- } else {
|
|
|
- // 否则重连
|
|
|
- this.websock.close()
|
|
|
- self.reconnect()
|
|
|
- }
|
|
|
- self.serverTimeoutObj = setTimeout(function () {
|
|
|
- // 超时关闭
|
|
|
- self.websock.close()
|
|
|
- }, self.timeout)
|
|
|
- }, self.timeout)
|
|
|
+ // self.timeoutObj = setTimeout(function () {
|
|
|
+ // // 这里发送一个心跳,后端收到后,返回一个心跳消息,
|
|
|
+ // console.log(self.websock)
|
|
|
+ // if (self.websock.readyState === 1) {
|
|
|
+ // // 如果连接正常
|
|
|
+ // self.websock.send('heartCheck') // 这里可以自己跟后端约定
|
|
|
+ // } else {
|
|
|
+ // // 否则重连
|
|
|
+ // // self.reconnect()
|
|
|
+ // }
|
|
|
+ // self.serverTimeoutObj = setTimeout(function () {
|
|
|
+ // // 超时关闭
|
|
|
+ // self.websock.close()
|
|
|
+ // }, self.timeout)
|
|
|
+ // }, self.timeout)
|
|
|
},
|
|
|
|
|
|
dropDown(res) {
|