feat: 历史记录页面 添加本地和云端两种记录支持,支持歌曲、歌单、专辑

This commit is contained in:
alger
2025-10-22 21:51:16 +08:00
parent a9adb6be36
commit 6d7ba6dbae
16 changed files with 1045 additions and 137 deletions
+14
View File
@@ -21,7 +21,9 @@ import { useRouter } from 'vue-router';
import TrafficWarningDrawer from '@/components/TrafficWarningDrawer.vue';
import { usePlayerStore } from '@/store/modules/player';
import { useSettingsStore } from '@/store/modules/settings';
import { useUserStore } from '@/store/modules/user';
import { isElectron, isLyricWindow } from '@/utils';
import { checkLoginStatus } from '@/utils/auth';
import { initAudioListeners, initMusicHook } from './hooks/MusicHook';
import { audioService } from './services/audioService';
@@ -31,6 +33,7 @@ import { useAppShortcuts } from './utils/appShortcuts';
const { locale } = useI18n();
const settingsStore = useSettingsStore();
const playerStore = usePlayerStore();
const userStore = useUserStore();
const router = useRouter();
// 监听语言变化
@@ -72,6 +75,17 @@ if (!isLyricWindow.value) {
settingsStore.initializeSettings();
settingsStore.initializeTheme();
settingsStore.initializeSystemFonts();
// 初始化登录状态 - 从 localStorage 恢复用户信息和登录类型
const loginInfo = checkLoginStatus();
if (loginInfo.isLoggedIn) {
if (loginInfo.user && !userStore.user) {
userStore.setUser(loginInfo.user);
}
if (loginInfo.loginType && !userStore.loginType) {
userStore.setLoginType(loginInfo.loginType);
}
}
}
handleSetLanguage(settingsStore.setData.language);