修改已知问题
This commit is contained in:
@@ -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')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user