修改已知问题
This commit is contained in:
@@ -37,22 +37,18 @@ export default new Vuex.Store({
|
||||
that.commit('start')
|
||||
}
|
||||
state.ws.onmessage = function(res) {
|
||||
console.log(res)
|
||||
if (res.data === 'heartCheck') {
|
||||
// 收到服务器信息,心跳重置
|
||||
that.commit('reset')
|
||||
console.log('socket-heartCheck')
|
||||
} else {
|
||||
state.msg = res
|
||||
}
|
||||
}
|
||||
state.ws.onclose = function(res) {
|
||||
console.log('Connection closed...')
|
||||
//重连
|
||||
that.commit('reconnect')
|
||||
}
|
||||
state.ws.onerror = function(res) {
|
||||
console.log('Connection error...')
|
||||
//重连
|
||||
that.commit('reconnect')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user