Skip to content

Commit f6ecaf4

Browse files
author
OpenClaw
committed
fix(frontend): use real API for artist list
- Replace mock data with artistApi.list() call - Import artistApi from client - Display real track_count from backend
1 parent 5527dfc commit f6ecaf4

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

frontend/src/views/artist/ArtistListView.vue

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
import { ref, computed, onMounted } from 'vue'
9393
import { useRouter } from 'vue-router'
9494
import GlassCard from '@/components/ui/GlassCard.vue'
95+
import { artistApi } from '@/api/client'
9596
9697
interface Artist {
9798
id: number
@@ -120,20 +121,13 @@ const filteredArtists = computed(() => {
120121
const loadArtists = async () => {
121122
loading.value = true
122123
try {
123-
// TODO: 调用 API 获取艺术家列表
124-
artists.value = [
125-
{ id: 1, name: '周杰伦', image_url: '', trackCount: 234 },
126-
{ id: 2, name: '林俊杰', image_url: '', trackCount: 156 },
127-
{ id: 3, name: '陈奕迅', image_url: '', trackCount: 189 },
128-
{ id: 4, name: '张学友', image_url: '', trackCount: 267 },
129-
{ id: 5, name: '邓紫棋', image_url: '', trackCount: 98 },
130-
{ id: 6, name: 'Ed Sheeran', image_url: '', trackCount: 145 },
131-
{ id: 7, name: 'Taylor Swift', image_url: '', trackCount: 178 },
132-
{ id: 8, name: 'The Weeknd', image_url: '', trackCount: 123 },
133-
]
134-
total.value = artists.value.length
124+
const res = await artistApi.list({ limit: 100 })
125+
artists.value = res.data || []
126+
total.value = res.total || 0
135127
} catch (error) {
136128
console.error('Failed to load artists:', error)
129+
artists.value = []
130+
total.value = 0
137131
} finally {
138132
loading.value = false
139133
}

0 commit comments

Comments
 (0)