import { defineStore } from 'pinia'; export const useSystemStore = defineStore('system', { state: () => { return { bgColor:'#a6f9f9', systemInfo:{} }; }, actions: { /* 系统信息 */ setInfo(info) { const value = uni.getStorageSync('systemInfo'); if(value){ this.systemInfo = value }else{ this.systemInfo = uni.getSystemInfoSync() this.save(); //保存本地 } }, /* 本地保存 */ save() { //保存本地存储凭证 uni.setStorageSync("systemInfo", this.systemInfo); } }, });