Commit a0cbe8219f94043656b96db6998f4c89cc8e96f7
1 parent
6f4c4fc6
修改websocket的test消息;
Showing
1 changed file
with
2 additions
and
10 deletions
src/mes/indexMes/index.js
| @@ -334,7 +334,7 @@ const useIndexMesEvent = props => { | @@ -334,7 +334,7 @@ const useIndexMesEvent = props => { | ||
| 334 | [currentContent, sModelsId, sModelType] | 334 | [currentContent, sModelsId, sModelType] |
| 335 | ); | 335 | ); |
| 336 | 336 | ||
| 337 | - const { webSocket: ws } = props.app; | 337 | + const { webSocket: ws, userinfo } = props.app; |
| 338 | const { url } = ws || {}; | 338 | const { url } = ws || {}; |
| 339 | const wsRef = useRef(ws); | 339 | const wsRef = useRef(ws); |
| 340 | useEffect(() => { | 340 | useEffect(() => { |
| @@ -354,15 +354,7 @@ const useIndexMesEvent = props => { | @@ -354,15 +354,7 @@ const useIndexMesEvent = props => { | ||
| 354 | return; | 354 | return; |
| 355 | } | 355 | } |
| 356 | if (wsRef.current.readyState !== WebSocket.OPEN) return; | 356 | if (wsRef.current.readyState !== WebSocket.OPEN) return; |
| 357 | - const message = { | ||
| 358 | - connectTest: 'test', | ||
| 359 | - key: 'test', | ||
| 360 | - flag: 'test', | ||
| 361 | - msg: 'test', | ||
| 362 | - sId: 'test', | ||
| 363 | - showType: 'test', | ||
| 364 | - sendFrom: props.app.userinfo.sId, | ||
| 365 | - }; | 357 | + const message = { flag: "connectTest", sId: "test", sendFrom: userinfo.sId }; |
| 366 | wsRef.current.send(JSON.stringify(message)); | 358 | wsRef.current.send(JSON.stringify(message)); |
| 367 | window.wsTimer = setTimeout(() => { | 359 | window.wsTimer = setTimeout(() => { |
| 368 | console.log("================未收到Test返回消息,webSocket重新连接======================"); | 360 | console.log("================未收到Test返回消息,webSocket重新连接======================"); |