路由懒加载 还要取消暂停路径规划接口 接入

This commit is contained in:
mmc
2026-06-02 17:32:29 +08:00
parent 69a8a47d0d
commit 1a87d659f4
4 changed files with 203 additions and 35 deletions

View File

@@ -367,7 +367,9 @@ export default function DeviceStatusPage({
controllerRef.current = controller;
return () => {
controller.destroy();
controller?.destroy();
controllerRef.current?.destroy();
controllerRef.current = null;
};
}, [userInfo, messageApi]);
@@ -376,11 +378,7 @@ 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]);
// 定时获取无人机状态

View File

@@ -62,7 +62,7 @@ export default function RobotTaskPage() {
const controller = new DeviceController(userInfo, messageApi);
controllerRef.current = controller;
return () => {
controllerRef.current.destroy();
controllerRef.current?.destroy();
controllerRef.current = null;
}