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 初始化