| | |
| | | console.error('WebSocket连接异常关闭'); |
| | | } |
| | | }; |
| | | |
| | | // 监听WebSocket的消息事件 |
| | | ws.onmessage = (event) => { |
| | | try { |
| | | const data = JSON.parse(event.data); // 解析消息为JSON |
| | | |
| | | const data = JSON.parse(event.data.replace('<END>', '')); // 解析消息为JSON |
| | | |
| | | if (data && Array.isArray(data.InkageStatus) && data.InkageStatus.length > 0) { |
| | | if(data.InkageStatus!=null){ |
| | |
| | | } |
| | | } else { |
| | | // 处理错误情况或无效数据 |
| | | console.error('接收到的数据无效', data); |
| | | // console.error('接收到的数据无效', data); |
| | | } |
| | | } catch (error) { |
| | | console.error('解析WebSocket消息时发生错误', error); |
| | | // console.error('解析WebSocket消息时发生错误', error); |
| | | } |
| | | }; |
| | | const confirmCutting = async () => { |