31 lines
549 B
TypeScript
31 lines
549 B
TypeScript
import {defineStore} from "pinia";
|
|
|
|
|
|
interface AccessState {
|
|
token: string,
|
|
userInfo: UserState
|
|
}
|
|
|
|
interface UserState {
|
|
nickname: string,
|
|
tel: string,
|
|
avatar: string,
|
|
wx_openid: string
|
|
}
|
|
|
|
//@ts-ignore
|
|
export const useUserStore = defineStore("app-access", {
|
|
state: (): AccessState => ({
|
|
token: '',
|
|
userInfo: {
|
|
nickname: '', //姓名
|
|
avatar: '', //头像
|
|
tel: '', //手机号
|
|
wx_openid: '',
|
|
},
|
|
}),
|
|
persist: {
|
|
enabled: true,
|
|
}
|
|
})
|