张含笑
2025-11-25 75f956534a20ecdec0716db3262477e5fb2c895b
src/store/modules/app/index.js
@@ -7,7 +7,9 @@
const useAppStore = defineStore('app', {
  state: () => ({
    systemInfo: {}, // 原本 TS: {} as UniApp.GetSystemInfoResult
    theme: storage.get(THEME_KEY) || 'light'
    theme: storage.get(THEME_KEY) || 'light',
    deviceUpdateKey: 0, //设备刷新key
    jobUpdateKey: 0, //任务刷新key
  }),
  getters: {
    getSystemInfo (state) {
@@ -21,6 +23,13 @@
    setSystemInfo (info) {
      this.systemInfo = info
    },
    setDeviceUpdateKeyAdd () {
      console.log(111, this.deviceUpdateKey + 1)
      this.deviceUpdateKey = this.deviceUpdateKey + 1
    },
    setJobUpdateKeyAdd (state, data) {
      this.deviceUpdateKey = this.deviceUpdateKey + 1
    },
    initSystemInfo () {
      uni.getSystemInfo({
        success: (res) => {