import {defineStore} from "pinia"; import storage from "@/utils/storage"; export const useUserStore = defineStore({ id: 'user', state: () => ({ mac: null, token: null, }), getters: {}, actions: { _init() { this.checkLogin() this.getMachineInfo() }, checkLogin() { let token = storage.getKey('LOGIN_TEACHER_TOKEN') if (token) { this.token = token this.getMachineInfo() } }, logout() { this.token = null }, getMachineInfo() { this.mac = '123' }, } })