update:优化设备缓存逻辑

This commit is contained in:
2026-06-11 18:10:59 +08:00
parent bfdd40ec93
commit 5cf243d187
6 changed files with 55 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ import {
import useStore from "@/store";
const store = useStore();
const { updateUser, updateDevice, updateOnline } = store;
const { updateUser, updateDevice, updateOnline, clearDevice } = store;
const props = defineProps({
show: {
@@ -107,6 +107,8 @@ async function doLogin() {
);
const data = await getDeviceBatteryAPI();
updateOnline(data.online);
} else {
clearDevice();
}
props.onClose();
} catch (error) {