细节优化
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user