mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-24 08:07:23 +08:00
feat: 日推不感兴趣调用官方接口
This commit is contained in:
@@ -18,22 +18,28 @@ export function navigateToMusicList(
|
||||
canRemove?: boolean;
|
||||
}
|
||||
) {
|
||||
const musicStore = useMusicStore();
|
||||
const { id, type, name, songList, listInfo, canRemove = false } = options;
|
||||
const musicStore = useMusicStore();
|
||||
const { id, type, name, songList, listInfo, canRemove = false } = options;
|
||||
|
||||
// 保存数据到状态管理
|
||||
musicStore.setCurrentMusicList(songList, name, listInfo, canRemove);
|
||||
// 如果是每日推荐,不需要设置 musicStore,直接从 recommendStore 获取
|
||||
if (type !== 'dailyRecommend') {
|
||||
musicStore.setCurrentMusicList(songList, name, listInfo, canRemove);
|
||||
} else {
|
||||
// 确保 musicStore 的数据被清空,避免显示旧的列表
|
||||
musicStore.clearCurrentMusicList();
|
||||
}
|
||||
|
||||
// 路由跳转
|
||||
if (id) {
|
||||
// 路由跳转
|
||||
if (id) {
|
||||
router.push({
|
||||
name: 'musicList',
|
||||
params: { id },
|
||||
query: { type }
|
||||
});
|
||||
} else {
|
||||
} else {
|
||||
router.push({
|
||||
name: 'musicList'
|
||||
name: 'musicList',
|
||||
query: { type: 'dailyRecommend' }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user