fix: 修复课程列表API路径和数据结构
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
yuliang_guo
2026-01-30 17:39:40 +08:00
parent 14e2e948f5
commit a6a87e2d41
2 changed files with 4 additions and 2 deletions

View File

@@ -567,7 +567,9 @@ const loadCourses = async () => {
coursesLoading.value = true
try {
const res = await getManagerCourses({ page: 1, size: 200 })
courses.value = res.items || []
// API返回格式: { code, message, data: { items, total, page, size } }
courses.value = res.data?.items || res.items || []
console.log('加载课程列表成功:', courses.value.length, '门课程')
} catch (error) {
console.error('加载课程列表失败:', error)
} finally {