视频测试

This commit is contained in:
Guwan 2024-12-08 16:58:28 +08:00
parent e894c20b98
commit 6812f9db1d
2 changed files with 19 additions and 16 deletions

View File

@ -1,3 +1,4 @@
import request from '@/utils/request'
// 模拟延迟 // 模拟延迟
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)) const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms))
@ -108,7 +109,7 @@ export const videoApi = {
keyword?: string keyword?: string
}) { }) {
const res = await request.get('/videos', { params }) const res = await request.get('/videos', { params })
return res.data return res
}, },
// 获取视频详情 // 获取视频详情

View File

@ -220,8 +220,10 @@ const getVideoList = async () => {
pageSize: pageSize.value, pageSize: pageSize.value,
keyword: searchKeyword.value keyword: searchKeyword.value
}) })
videoList.value = res.records console.log(res)
total.value = res.total //{records: Array(1), total: 0, size: 12, current: 1, pages: 0}
videoList.value = res
// total.value = res.total
} catch (error) { } catch (error) {
console.error('Failed to load videos:', error) console.error('Failed to load videos:', error)
ElMessage.error('加载视频列表失败') ElMessage.error('加载视频列表失败')