feat: 优化
This commit is contained in:
@@ -7,6 +7,18 @@ import { getUserProfile } from '@/api/auth'
|
||||
|
||||
const STORAGE_KEY = 'user_store_v1'
|
||||
|
||||
/**
|
||||
* @typedef {Object} UserProfile
|
||||
* @property {string} [registerTime]
|
||||
* @property {string} [createTime]
|
||||
* @property {string} [mobile]
|
||||
* @property {number} [remainingPoints]
|
||||
* @property {number} [remainingStorage]
|
||||
* @property {number} [usedStorage]
|
||||
* @property {number} [totalStorage]
|
||||
* @property {number} [totalRecharge]
|
||||
*/
|
||||
|
||||
export const useUserStore = defineStore('user', () => {
|
||||
const isLoggedIn = ref(false)
|
||||
const isHydrated = ref(false)
|
||||
@@ -18,6 +30,7 @@ export const useUserStore = defineStore('user', () => {
|
||||
const mobile = ref('')
|
||||
|
||||
// 档案数据(来自 MemberUserProfile)
|
||||
/** @type {import('vue').Ref<UserProfile|null>} */
|
||||
const profile = ref(null)
|
||||
const remainingPoints = computed(() => profile.value?.remainingPoints ?? 0)
|
||||
const remainingStorage = computed(() => profile.value?.remainingStorage ?? 10) // GB
|
||||
|
||||
Reference in New Issue
Block a user