机器人任务界面加入 websocket连接 卸载页面 的时候断开连接

This commit is contained in:
mmc
2026-06-02 16:42:31 +08:00
parent a909fa5890
commit 69a8a47d0d
2 changed files with 58 additions and 9 deletions

View File

@@ -376,6 +376,11 @@ export default function DeviceStatusPage({
if (!device || !controllerRef.current || !device?.serialNumber || isUAV) return;
controllerRef.current.connectDevice(device);
return () => {
controllerRef.current.destroy();
controllerRef.current = null;
}
}, [device?.serialNumber]);
// 定时获取无人机状态