From 6812f9db1df342d704aab450dea219720902d4ed Mon Sep 17 00:00:00 2001 From: Guwan Date: Sun, 8 Dec 2024 16:58:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/video.ts | 5 +++-- src/views/VideoView.vue | 30 ++++++++++++++++-------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/api/video.ts b/src/api/video.ts index 1e1ca0f..a0b497a 100644 --- a/src/api/video.ts +++ b/src/api/video.ts @@ -1,3 +1,4 @@ +import request from '@/utils/request' // 模拟延迟 const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)) @@ -108,7 +109,7 @@ export const videoApi = { keyword?: string }) { const res = await request.get('/videos', { params }) - return res.data + return res }, // 获取视频详情 @@ -203,4 +204,4 @@ export interface ApiResponse { code: number message: string data: T -} \ No newline at end of file +} diff --git a/src/views/VideoView.vue b/src/views/VideoView.vue index d1619bc..e28d045 100644 --- a/src/views/VideoView.vue +++ b/src/views/VideoView.vue @@ -26,12 +26,12 @@
-
@@ -55,19 +55,19 @@
- - - @@ -117,7 +117,7 @@ - - { pageSize: pageSize.value, keyword: searchKeyword.value }) - videoList.value = res.records - total.value = res.total + console.log(res) + //{records: Array(1), total: 0, size: 12, current: 1, pages: 0} + videoList.value = res + // total.value = res.total } catch (error) { console.error('Failed to load videos:', error) ElMessage.error('加载视频列表失败') @@ -269,7 +271,7 @@ const handleUpload = async () => { formData.append('title', uploadForm.value.title) formData.append('description', uploadForm.value.description) formData.append('tags', uploadForm.value.tags) - + await videoApi.upload(formData) ElMessage.success('上传成功') uploadDialogVisible.value = false @@ -483,4 +485,4 @@ onMounted(() => { .meta .el-icon { font-size: 16px; } - \ No newline at end of file +