refactor(frontend): Rework home layout and user interactions

This commit is contained in:
2026-04-22 16:45:00 +08:00
parent 79f255bf6c
commit 59e87faba9
84 changed files with 8299 additions and 2181 deletions
+7 -6
View File
@@ -5,6 +5,7 @@ import type {
VideoUpdateParams,
VideoQueryParams,
VideoUploadParams,
VideoUploadResult,
PlayRecord,
PageResult
} from '@/types'
@@ -18,14 +19,14 @@ export const videoApi = {
/**
* 上传视频文件
*/
uploadVideo(params: VideoUploadParams): Promise<{ videoUrl: string; coverUrl: string }> {
uploadVideo(params: VideoUploadParams): Promise<VideoUploadResult> {
return request.upload('/content/video/upload', params.file, params.onProgress)
},
/**
* 创建视频记录
*/
createVideo(params: VideoCreateParams): Promise<VideoInfo> {
createVideo(params: VideoCreateParams): Promise<number> {
return request.post('/content/video', params)
},
@@ -101,8 +102,8 @@ export const videoApi = {
/**
* 投币
*/
coinVideo(videoId: number): Promise<void> {
return request.post(`/content/video/coin/${videoId}`)
coinVideo(videoId: number, amount = 1): Promise<void> {
return request.post(`/content/video/coin/${videoId}?amount=${amount}`)
},
/**
@@ -122,8 +123,8 @@ export const videoApi = {
/**
* 分享视频
*/
shareVideo(videoId: number): Promise<void> {
return request.post(`/content/video/share/${videoId}`)
shareVideo(videoId: number, platform = 'web'): Promise<void> {
return request.post(`/content/video/share/${videoId}?platform=${platform}`)
},
/**