更新:阿里云视频播放器
This commit is contained in:
@@ -11,9 +11,6 @@ import type {
|
||||
IPageData
|
||||
} from '@/types/user'
|
||||
import { SERVICE_MAP } from '@/api/config'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
@@ -46,7 +43,7 @@ export async function getOrderList(current: number, limit: number, orderStatus:
|
||||
const res = await mainClient.request<IApiResponse<{ orders: IPageData<IOrder> }>>({
|
||||
url: 'common/buyOrder/commonBuyOrderList',
|
||||
method: 'POST',
|
||||
data: { current, limit, orderStatus, come: '10', userId: userStore.id }
|
||||
data: { current, limit, orderStatus, come: '10', userId: uni.getStorageSync('userInfo').id }
|
||||
})
|
||||
return res
|
||||
}
|
||||
|
||||
68
api/modules/video.ts
Normal file
68
api/modules/video.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
// api/modules/video.ts
|
||||
/**
|
||||
* 视频相关 API
|
||||
* 完全保持原项目接口路径和调用方式
|
||||
*/
|
||||
|
||||
import { createRequestClient } from '../request'
|
||||
import { SERVICE_MAP } from '../config'
|
||||
import type {
|
||||
ICheckVideoRequest,
|
||||
ICheckVideoResponse,
|
||||
ISaveCoursePositionRequest,
|
||||
ISaveCoursePositionResponse,
|
||||
IAddErrorCourseRequest,
|
||||
IAddErrorCourseResponse
|
||||
} from '@/types/video'
|
||||
|
||||
const client = createRequestClient({ baseURL: SERVICE_MAP.MAIN })
|
||||
|
||||
/**
|
||||
* 视频相关 API
|
||||
*/
|
||||
export const videoApi = {
|
||||
/**
|
||||
* 检查视频并获取播放凭证
|
||||
* 原接口: sociology/course/checkVideo
|
||||
*
|
||||
* @param data 视频信息(id, video, courseId, catalogueId, chapterId 等)
|
||||
* @returns 视频详细信息,包含 playAuth, videoId, m3u8Url, videoUrl 等
|
||||
*/
|
||||
checkVideo(data: ICheckVideoRequest) {
|
||||
return client.request<ICheckVideoResponse>({
|
||||
url: 'sociology/course/checkVideo',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 保存课程播放位置
|
||||
* 原接口: sociology/course/saveCoursePosition
|
||||
*
|
||||
* @param data 包含 videoId 和 position(秒数)
|
||||
* @returns 保存结果
|
||||
*/
|
||||
saveCoursePosition(data: ISaveCoursePositionRequest) {
|
||||
return client.request<ISaveCoursePositionResponse>({
|
||||
url: 'sociology/course/saveCoursePosition',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 记录 iOS 不支持的视频
|
||||
* 原接口: medical/course/addErrorCourse
|
||||
*
|
||||
* @param data 包含 chapterId, videoId, sort
|
||||
* @returns 记录结果
|
||||
*/
|
||||
addErrorCourse(data: IAddErrorCourseRequest) {
|
||||
return client.request<IAddErrorCourseResponse>({
|
||||
url: 'medical/course/addErrorCourse',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user