feat: 优化

This commit is contained in:
2026-03-28 01:34:42 +08:00
parent 31bc804074
commit 4c395b73ca
82 changed files with 328 additions and 31927 deletions

View File

@@ -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