feat: 扩展数据层与播放能力

This commit is contained in:
alger
2026-02-04 20:10:28 +08:00
parent a44addef22
commit 3a3820cf52
29 changed files with 1111 additions and 675 deletions
+7 -2
View File
@@ -1,9 +1,10 @@
import { defineStore } from 'pinia';
import { ref } from 'vue';
import { computed, ref } from 'vue';
import { logout } from '@/api/login';
import { getLikedList } from '@/api/music';
import { getUserAlbumSublist, getUserPlaylist } from '@/api/user';
import type { IUserDetail } from '@/types/user';
import { clearLoginStatus } from '@/utils/auth';
interface UserData {
@@ -23,6 +24,8 @@ function getLocalStorageItem<T>(key: string, defaultValue: T): T {
export const useUserStore = defineStore('user', () => {
// 状态
const user = ref<UserData | null>(getLocalStorageItem('user', null));
const userDetail = ref<IUserDetail | null>(null);
const recordList = ref<any[]>([]);
const loginType = ref<'token' | 'cookie' | 'qr' | 'uid' | null>(
getLocalStorageItem('loginType', null)
);
@@ -205,6 +208,8 @@ export const useUserStore = defineStore('user', () => {
initializeCollectedAlbums,
addCollectedAlbum,
removeCollectedAlbum,
isAlbumCollected
isAlbumCollected,
userDetail,
recordList
};
});