123456789101112131415161718192021222324252627282930313233 |
- 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);
- }
- },
- });
|