feat: add QQ Music API integration, Pinia home cache, and unified search

- Start @sansenjian/qq-music-api server via dynamic import in api-server.ts
- Rewrite QQ Music provider to use real API endpoints (getSearchByKey,
  getMusicPlay, getSongListDetail, getAlbumInfo, getLyric, etc.)
- Cache home page data (recommend playlists, daily songs, user playlists)
  in Pinia store with 5-minute TTL to avoid refetching on every mount
- Add unified /api/music/search/all endpoint that queries both Netease
  and QQ providers in parallel and returns merged results
- Remove platform toggle from Search.vue; search both platforms at once
- Add platform badge (网易云 / QQ) to SongCard component

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
saopig1andClaude Opus 4.6 committed 2026-03-30 02:31:15 +08:00
1 parent ce6fc92780
commit 94a0df8391
8 files changed
+195 -155

No files matched your search

+33 -1
View File
@@ -3,7 +3,13 @@
<div class="song-index">{{ index }}</div>
<CoverArt :url="song.coverUrl" :size="36" :radius="6" />
<div class="song-info">
<div class="song-name">{{ song.name }}</div>
<div class="song-name-row">
<span class="song-name">{{ song.name }}</span>
<span
class="platform-badge"
:class="song.platform === 'qq' ? 'badge-qq' : 'badge-netease'"
>{{ song.platform === 'qq' ? 'QQ' : '网易云' }}</span>
</div>
<div class="song-artist">{{ song.artist }}</div>
</div>
<div class="song-album">{{ song.album }}</div>
@@ -73,6 +79,13 @@ function formatDuration(seconds: number): string {
min-width: 0;
}
.song-name-row {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
}
.song-name {
font-size: 14px;
font-weight: 500;
@@ -81,6 +94,25 @@ function formatDuration(seconds: number): string {
text-overflow: ellipsis;
}
.platform-badge {
flex-shrink: 0;
font-size: 10px;
font-weight: 600;
padding: 1px 5px;
border-radius: 3px;
line-height: 1.4;
}
.badge-netease {
background: rgba(232, 17, 35, 0.15);
color: #e81123;
}
.badge-qq {
background: rgba(18, 183, 106, 0.15);
color: #12b76a;
}
.song-artist {
font-size: 12px;
color: var(--text-secondary);