yunzer/frontend/src/store/auth.ts
2025-08-19 12:30:12 +08:00

29 lines
475 B
TypeScript

import { defineStore } from 'pinia'
const useAuthStore = defineStore('appauth', {
state: () => {
return {
isLogin: false,
_userInfo: null,
}
},
persist: true,
getters: {
userInfo(): IUser | null {
return this._userInfo
}
},
actions: {
login(data: any) {
this.isLogin = true
this._userInfo = data
},
},
})
export default useAuthStore