课程学习pingAPI请求

This commit is contained in:
禺狨 2023-03-27 16:08:59 +08:00
parent b45c7932ce
commit 7afb99751f
2 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,11 @@ export function record(courseId: number, hourId: number, duration: number) {
}); });
} }
//观看ping
export function playPing(courseId: number, hourId: number) {
return client.get(`/api/v1/course/${courseId}/hour/${hourId}/ping`, {});
}
//最近学习课程 //最近学习课程
export function latestLearn() { export function latestLearn() {
return client.get(`/api/v1/user/latest-learn`, {}); return client.get(`/api/v1/user/latest-learn`, {});

View File

@ -74,6 +74,7 @@ export const VideoModel: React.FC<PropInterface> = ({
if (duration - myRef.current >= 10 || isEnd === true) { if (duration - myRef.current >= 10 || isEnd === true) {
setPlayDuration(duration); setPlayDuration(duration);
course.record(cid, id, duration).then((res: any) => {}); course.record(cid, id, duration).then((res: any) => {});
course.playPing(cid, id).then((res: any) => {});
} }
}; };