feat: 登录页面
This commit is contained in:
37
src/stores/modules/account.ts
Normal file
37
src/stores/modules/account.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
/** 账户信息 */
|
||||
export interface AccountState {
|
||||
/** 账户ID */
|
||||
id: string
|
||||
/** 用户名 */
|
||||
username: string
|
||||
/** 年龄 */
|
||||
age?: number
|
||||
/** 性别 */
|
||||
sex?: string
|
||||
/** 手机号 */
|
||||
phone?: string
|
||||
/** 邮箱 */
|
||||
email?: string
|
||||
/** 头像 */
|
||||
avatar?: string
|
||||
/** 生日 */
|
||||
birthday?: string
|
||||
}
|
||||
|
||||
export const useAccountStore = defineStore(
|
||||
'account',
|
||||
() => {
|
||||
const accountInfo = ref<AccountState>()
|
||||
const token = ref('')
|
||||
|
||||
return { accountInfo, token }
|
||||
},
|
||||
{
|
||||
persist: {
|
||||
pick: ['accountInfo', 'token']
|
||||
}
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user