zs 2 years ago
parent
commit
591d866d6a
1 changed files with 2 additions and 6 deletions
  1. 2 6
      store/websocketStore.js

+ 2 - 6
store/websocketStore.js

@@ -32,7 +32,7 @@ const store = new Vuex.Store({
 			state.socketTask.onOpen(() => dispatch('websocketOnOpen'))
 			state.socketTask.onMessage(res => dispatch('websocketOnMessage', res))
 			state.socketTask.onClose(e => dispatch('websocketOnClose', url));
-			state.socketTask.onError(e => dispatch('websocketOnError', url));
+			state.socketTask.onError(e => dispatch('websocketOnError'));
 		},
 		websocketOnOpen({
 			commit
@@ -66,11 +66,7 @@ const store = new Vuex.Store({
 		websocketOnError({
 			commit,
 			dispatch
-		}, url) {
-			dispatch('websocketClose')
-			setTimeout(() => {
-				dispatch('websocketInit', url)
-			}, 3000)
+		}) {
 			console.log('WebSocket连接错误')
 		},
 		websocketClose({