Commit e41f8533 authored by 赵啸非's avatar 赵啸非

修改消息组件

parent 2556e888
...@@ -5,5 +5,5 @@ NODE_ENV = 'production' ...@@ -5,5 +5,5 @@ NODE_ENV = 'production'
VUE_APP_BASE_API = http://192.168.0.98:11091/m VUE_APP_BASE_API = http://192.168.0.98:11091/m
# websocket地址 # websocket地址
VUE_APP_WEBSOCKET_API =192.168.0.98:11091/ws VUE_APP_WEBSOCKET_API =192.168.0.98:18222/m
...@@ -32,6 +32,8 @@ const onerrorWS = () => { ...@@ -32,6 +32,8 @@ const onerrorWS = () => {
Socket.close() Socket.close()
clearInterval(setIntervalWesocketPush) clearInterval(setIntervalWesocketPush)
console.log('连接失败重连中') console.log('连接失败重连中')
setTimeout(() => {
}, 1000)
if (Socket.readyState !== 3) { if (Socket.readyState !== 3) {
Socket = null Socket = null
createSocket(reUrl) createSocket(reUrl)
...@@ -80,6 +82,8 @@ export const sendWSPush = message => { ...@@ -80,6 +82,8 @@ export const sendWSPush = message => {
const oncloseWS = () => { const oncloseWS = () => {
clearInterval(setIntervalWesocketPush) clearInterval(setIntervalWesocketPush)
console.log('websocket已断开....正在尝试重连') console.log('websocket已断开....正在尝试重连')
setTimeout(() => {
}, 1000)
if (Socket.readyState !== 2) { if (Socket.readyState !== 2) {
Socket = null Socket = null
createSocket(reUrl) createSocket(reUrl)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment