diff --git a/src/mes/indexMes/index.js b/src/mes/indexMes/index.js index 9f838fb..c0168b5 100644 --- a/src/mes/indexMes/index.js +++ b/src/mes/indexMes/index.js @@ -334,7 +334,7 @@ const useIndexMesEvent = props => { [currentContent, sModelsId, sModelType] ); - const { webSocket: ws } = props.app; + const { webSocket: ws, userinfo } = props.app; const { url } = ws || {}; const wsRef = useRef(ws); useEffect(() => { @@ -354,15 +354,7 @@ const useIndexMesEvent = props => { return; } if (wsRef.current.readyState !== WebSocket.OPEN) return; - const message = { - connectTest: 'test', - key: 'test', - flag: 'test', - msg: 'test', - sId: 'test', - showType: 'test', - sendFrom: props.app.userinfo.sId, - }; + const message = { flag: "connectTest", sId: "test", sendFrom: userinfo.sId }; wsRef.current.send(JSON.stringify(message)); window.wsTimer = setTimeout(() => { console.log("================未收到Test返回消息,webSocket重新连接======================");