initHeader

This commit is contained in:
2024-08-22 11:27:06 +08:00
parent fe895bd37c
commit e0aaa7a30d
178 changed files with 5726 additions and 4999 deletions

View File

@@ -0,0 +1,24 @@
import { defineStore } from "pinia";
import { UserState } from "@/stores/interface";
import piniaPersistConfig from "@/stores/helper/persist";
import {USER_STORE_KEY} from "@/stores/constant";
export const useUserStore = defineStore({
id: USER_STORE_KEY,
state: (): UserState => ({
token: "",
userInfo: { name: "admin" }
}),
getters: {},
actions: {
// Set Token
setToken(token: string) {
this.token = token;
},
// Set setUserInfo
setUserInfo(userInfo: UserState["userInfo"]) {
this.userInfo = userInfo;
}
},
persist: piniaPersistConfig(USER_STORE_KEY)
});