1234567891011121314151617181920212223242526272829 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const useSystemStore = common_vendor.defineStore("system", {
- state: () => {
- return {
- bgColor: "rgb(0, 255, 255, 0.2)",
- systemInfo: {}
- };
- },
- actions: {
- /*
- 系统信息
- */
- setInfo(info) {
- const value = common_vendor.index.getStorageSync("systemInfo");
- if (value) {
- this.systemInfo = value;
- } else {
- this.systemInfo = common_vendor.index.getSystemInfoSync();
- this.save();
- }
- },
- /* 本地保存 */
- save() {
- common_vendor.index.setStorageSync("systemInfo", this.systemInfo);
- }
- }
- });
- exports.useSystemStore = useSystemStore;
|