| | |
| | | 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) { |
| | |
| | | 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) => { |