From d31832682c943becf17bb544d6edb517e82bab3c Mon Sep 17 00:00:00 2001 From: guoapeng Date: Mon, 7 Jul 2025 11:10:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=8E=B7=E5=8F=96=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.vue | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/app.vue b/src/app.vue index 389b2b6..23ed3cc 100644 --- a/src/app.vue +++ b/src/app.vue @@ -17,6 +17,7 @@ import { useSealStore } from './stores/sealStore' */ // 状态管理 +const deviceStore = useDeviceStore() const homeStore = useHomeStore() const formulaStore = useFormulaStore() const liquidStore = useLiquidStore() @@ -37,6 +38,7 @@ let timer: any = null // 进度条定时器 onBeforeMount(async () => { startProgress() // 启动进度条 await systemStore.getSystemTime() // 获取系统时间 + await initDeviceInfo() }) // 监听设备的主动上报数据,并根据上报类型 保存到对应的store subscribeEvent('stateUpdate', (data) => { @@ -113,15 +115,15 @@ const initData = async () => { * @function 初始化设备信息 * @desc 从服务端获取设备信息并更新到状态存储 */ -// const initDeviceInfo = async () => { -// const deviceParams = { -// className: 'DeviceInfoMgrService', -// fnName: 'getDeviceInfo', -// } -// const res = await sendCmd(deviceParams) -// deviceStore.updateDeviceInfo(res) -// return res -// } +const initDeviceInfo = async () => { + const deviceParams = { + className: 'DeviceInfoMgrService', + fnName: 'getDeviceInfo', + } + const res = await sendCmd(deviceParams) + deviceStore.updateDeviceInfo(res) + return res +} /** * @function 初始化