diff --git a/src/api/video.ts b/src/api/video.ts index d7934ec..1e1ca0f 100644 --- a/src/api/video.ts +++ b/src/api/video.ts @@ -41,7 +41,7 @@ const mockVideos: Video[] = [ duration: '15:30', category: 'health', views: 2345, - description: '专业��生讲解养生知识', + description: '专业医生讲解养生知识', uploadTime: '2024-03-19', likes: 342, comments: 67, @@ -99,54 +99,108 @@ export const videoCategories = [ { label: '新闻资讯', value: 'news' } ] -// 模拟 API 接口 +// 视频相关接口 export const videoApi = { // 获取视频列表 - async getVideoList(category: string = ''): Promise { - await delay(500) // 模拟网络延迟 - return mockVideos.filter(video => - category ? video.category === category : true - ) + async getList(params: { + pageNum?: number + pageSize?: number + keyword?: string + }) { + const res = await request.get('/videos', { params }) + return res.data }, // 获取视频详情 - async getVideoDetail(id: number): Promise