mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-05-15 00:27:32 +08:00
feat: 历史记录页面 添加本地和云端两种记录支持,支持歌曲、歌单、专辑
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user