@@ -46,7 +59,6 @@ const navItems = [
{ path: "/", label: "歌单", icon: "home" },
{ path: "/ranking", label: "排行榜", icon: "trophy" },
{ path: "/library", label: "我的音乐", icon: "music" },
- { path: "/settings", label: "设置", icon: "settings" },
{ path: "/demo", label: "演示", icon: "play" },
] as const
@@ -74,7 +86,7 @@ watch(
.sidebar {
display: flex;
flex-direction: column;
- width: clamp(200px, 16vw, 232px);
+ width: clamp(168px, 13vw, 196px);
height: 100vh;
flex-shrink: 0;
padding: 20px 14px 14px;
@@ -84,8 +96,9 @@ watch(
.brand {
display: flex;
+ flex-direction: column;
align-items: center;
- gap: 10px;
+ gap: 6px;
padding: 0 10px 18px;
}
@@ -100,6 +113,14 @@ watch(
box-shadow: 0 6px 14px rgba(34, 197, 94, 0.35);
}
+.brand-logo {
+ display: block;
+ width: 64px;
+ height: 64px;
+ object-fit: contain;
+ margin: 0 auto;
+}
+
.brand-name {
font-size: 17px;
font-weight: 700;
@@ -112,6 +133,15 @@ watch(
gap: 4px;
}
+.nav-settings {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ margin-top: auto;
+ padding-top: 12px;
+ border-top: 1px solid var(--app-border);
+}
+
.nav-item {
display: flex;
align-items: center;
@@ -236,6 +266,11 @@ watch(
width: 100%;
}
+ .nav-settings {
+ width: 100%;
+ margin-top: auto;
+ }
+
.nav-item {
justify-content: center;
padding: 10px 0;
diff --git a/src/views/DiscoverView.vue b/src/views/DiscoverView.vue
index f3bf3b9..1ba4be2 100644
--- a/src/views/DiscoverView.vue
+++ b/src/views/DiscoverView.vue
@@ -60,7 +60,7 @@ let loadSeq = 0
/** 获取歌单分类 */
const list = async () => {
const res = await PlayListApi.categoryList([settingsStore.defaultSource])
- categories.value = res[0].categories
+ categories.value = res.data[0].categories
if (categories.value.length > 0) {
activeCategory.value = categories.value[1].id
playList(activeCategory.value)
@@ -75,7 +75,7 @@ async function loadCategoryPlayList(categoryId: string, p: number) {
const res = await PlayListApi.categoryPlayList(categoryId, settingsStore.defaultSource, p, pageSize)
console.log(res)
if (seq !== loadSeq) return
- categoryPlaylists.value = res.playlists
+ categoryPlaylists.value = res.data.playlists
const n = categoryPlaylists.value.length
if (n === pageSize) {
// 满页:推测还有下一页
diff --git a/src/views/PlaylistDetailView.vue b/src/views/PlaylistDetailView.vue
index c8d634c..7192d34 100644
--- a/src/views/PlaylistDetailView.vue
+++ b/src/views/PlaylistDetailView.vue
@@ -86,7 +86,7 @@ const playlistSource = computed(
onMounted(async () => {
try {
const res = await PlayListApi.detail(playlistSource.value, props.id)
- songs.value = res.map((song) => ({
+ songs.value = res.data.map((song) => ({
id: song.id,
title: song.name,
artist: song.artist,
@@ -113,7 +113,8 @@ function playAll() {
async function playWithUrl(song: Song, queue?: Song[]) {
try {
const source = (song.source ?? playlistSource.value) as Source
- const { url } = await MusicApi.url(String(song.id), source)
+ const res = await MusicApi.url(String(song.id), source)
+ const url = res.data.url
playerStore.playSong(song, queue, url)
} catch {
// 拿不到直链时仍切歌,后续可尝试 MusicApi.stream 代理播放
diff --git a/src/views/SearchView.vue b/src/views/SearchView.vue
index eae285d..f7fced4 100644
--- a/src/views/SearchView.vue
+++ b/src/views/SearchView.vue
@@ -136,12 +136,12 @@ async function doSearch(q: string) {
])
if (seq !== requestSeq) return
if (songRes.status === "fulfilled") {
- songResults.value = (songRes.value.songs ?? []).map(toSong)
+ songResults.value = (songRes.value.data.songs ?? []).map(toSong)
} else {
songResults.value = []
}
if (playlistRes.status === "fulfilled") {
- playlistResults.value = (playlistRes.value.playlists ?? []).map(toPlaylist)
+ playlistResults.value = (playlistRes.value.data.playlists ?? []).map(toPlaylist)
} else {
playlistResults.value = []
}
@@ -179,8 +179,8 @@ async function playSearchSong(song: Song) {
try {
// const res = await MusicApi.musicUrl(String(song.id), source)
// const url = "http://127.0.0.1:81" + res.data[0].url
- const { url } = await MusicApi.url(String(song.id), source)
- // const url = "http://127.0.0.1:81" + res.data[0].url
+ const res = await MusicApi.url(String(song.id), source)
+ const url = res.data.url
console.log("url: ", url)
playerStore.playSong(song, songResults.value, url)
} catch {