细节优化

This commit is contained in:
kron
2026-01-07 15:12:18 +08:00
parent 494f83392e
commit 1f75045db4
6 changed files with 13 additions and 6 deletions

View File

@@ -10,10 +10,13 @@ import {
loginAPI,
getHomeData,
getPhoneNumberAPI,
getDeviceBatteryAPI,
} from "@/apis";
import useStore from "@/store";
const store = useStore();
const { updateUser, updateDevice } = store;
const { updateUser, updateDevice, updateOnline } = store;
const props = defineProps({
noBg: {
type: Boolean,
@@ -94,6 +97,8 @@ const handleLogin = async () => {
const devices = await getMyDevicesAPI();
if (devices.bindings && devices.bindings.length) {
updateDevice(devices.bindings[0].deviceId, devices.bindings[0].deviceName);
const data = await getDeviceBatteryAPI();
updateOnline(data.online);
}
loading.value = false;
props.onClose();