mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-06-26 02:07:30 +08:00
✨ feat: 优化音乐封面显示逻辑,确保在缺失封面时使用默认图片,并更新推荐专辑组件以显示封面
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
v-model:show="showMusic"
|
||||
:name="albumName"
|
||||
:song-list="songList"
|
||||
:cover="false"
|
||||
:cover="true"
|
||||
:loading="loadingList"
|
||||
:list-info="albumInfo"
|
||||
/>
|
||||
@@ -62,17 +62,19 @@ const handleClick = async (item: any) => {
|
||||
loadingList.value = true;
|
||||
showMusic.value = true;
|
||||
const res = await getAlbum(item.id);
|
||||
songList.value = res.data.songs.map((song: any) => {
|
||||
song.al.picUrl = song.al.picUrl || item.picUrl;
|
||||
const { songs, album } = res.data;
|
||||
songList.value = songs.map((song: any) => {
|
||||
song.al.picUrl = song.al.picUrl || album.picUrl;
|
||||
song.picUrl = song.al.picUrl || album.picUrl || song.picUrl;
|
||||
return song;
|
||||
});
|
||||
albumInfo.value = {
|
||||
...res.data.album,
|
||||
...album,
|
||||
creator: {
|
||||
avatarUrl: res.data.album.artist.img1v1Url,
|
||||
nickname: `${res.data.album.artist.name} - ${res.data.album.company}`
|
||||
avatarUrl: album.artist.img1v1Url,
|
||||
nickname: `${album.artist.name} - ${album.company}`
|
||||
},
|
||||
description: res.data.album.description
|
||||
description: album.description
|
||||
};
|
||||
loadingList.value = false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user