修改已知问题

This commit is contained in:
qq787203167
2022-06-01 09:28:25 +08:00
parent d73f86baa9
commit 69f916ef3c
-4
View File
@@ -37,22 +37,18 @@ export default new Vuex.Store({
that.commit('start') that.commit('start')
} }
state.ws.onmessage = function(res) { state.ws.onmessage = function(res) {
console.log(res)
if (res.data === 'heartCheck') { if (res.data === 'heartCheck') {
// 收到服务器信息,心跳重置 // 收到服务器信息,心跳重置
that.commit('reset') that.commit('reset')
console.log('socket-heartCheck')
} else { } else {
state.msg = res state.msg = res
} }
} }
state.ws.onclose = function(res) { state.ws.onclose = function(res) {
console.log('Connection closed...')
//重连 //重连
that.commit('reconnect') that.commit('reconnect')
} }
state.ws.onerror = function(res) { state.ws.onerror = function(res) {
console.log('Connection error...')
//重连 //重连
that.commit('reconnect') that.commit('reconnect')
} }