123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- /**
- * 授权 API
- */
- import {
- http
- } from '../request/main.js';
- /**
- * 获取分类列表
- *
- * @returns {Promise}
- */
- export function getCategoryList(id) {
- return http.post('/course/getCategoryList', {}, {
- muteLogin: true
- });
- }
- /**
- * 获取课程列表
- *
- * @returns {Promise}
- */
- export function getCourseList(category_id, group, sort, keyword, page, page_size) {
- return http.post('/course/getCourseList', {
- category_id,
- group,
- sort,
- keyword,
- page,
- page_size
- }, {
- muteLogin: true
- });
- }
- /**
- * 获取课程详情
- *
- * @returns {Promise}
- */
- export function getCourseDetail(id) {
- return http.post('/course/getCourseDetail', {
- id
- }, {
- muteLogin: true
- });
- }
- /**
- * 获取课程考核
- *
- * @returns {Promise}
- */
- export function getCourseExamine(id) {
- return http.post('/course/getCourseExamine', {
- id
- }, {
- muteLogin: true
- });
- }
- /**
- * 获取内容详情
- *
- * @returns {Promise}
- */
- export function getContentDetail(id) {
- return http.post('/course/getContentDetail', {
- id
- });
- }
- /**
- * 开始学习
- *
- * @returns {Promise}
- */
- export function startLearn(id) {
- return http.post('/course/startLearn', {
- id
- });
- }
- /**
- * 同步播放状态
- *
- * @returns {Promise}
- */
- export function syncPlayState(course_id, content_id, current_time, current_offset, play_time, sync_time) {
- return http.post('/course/syncPlayState', {
- course_id,
- content_id,
- current_time,
- current_offset,
- play_time,
- sync_time
- });
- }
- /**
- * 获取收藏列表
- *
- * @returns {Promise}
- */
- export function getLikeList(page, page_size) {
- return http.post('/course/getLikeList', {
- page,
- page_size
- });
- }
- /**
- * 收藏操作
- *
- * @returns {Promise}
- */
- export function handleLike(course_id, action) {
- return http.post('/course/handleLike', {
- course_id,
- action
- });
- }
- /**
- * 获取我的课程列表
- *
- * @returns {Promise}
- */
- export function getMineCourseList(page, page_size) {
- return http.post('/course/getMineCourseList', {
- page,
- page_size
- });
- }
- /**
- * 删除我的课程
- *
- * @returns {Promise}
- */
- export function mineCourseDelete(course_id) {
- return http.post('/course/mineCourseDelete', {
- course_id
- });
- }
- /**
- * 获取评价列表
- *
- * @returns {Promise}
- */
- export function getEvaluateList(teacher_id, page, page_size) {
- return http.post('/teacher/getEvaluateList', {
- teacher_id,
- page,
- page_size
- }, {
- muteLogin: true
- })
- }
|