123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- import APIConfig from './api.js';
- import efunRequest from '../utils/efunRequest'
- export default class CourseDetails {
- // 获取课程详细信息
- static getCourseDetails(courseId) {
- return efunRequest.getHttpRequest().url(`http://ott80testlibrary.yifangjiaoyu.cn/mobile/course/${courseId}`).get();
- }
- // 获取评论列表
- static getPostsList(columnId) {
- console.log(columnId)
- return efunRequest.getHttpRequest().url(`http://ott80test-base.yifangjiaoyu.cn/mobile/posts`).header({
- uid: ''
- }).params({
- columnId,
- pageNo: '',
- pageSize: ''
- }).get();
- }
- // 收藏
- static setFavorites(data) {
- return fetch(`http://ott80test-base.yifangjiaoyu.cn/mobile/favorites`,{
- method:"POST",
- headers:{
- "Accept": "application/json",
- "Content-Type": "application/json",
- "uid": ""
- },
- body: JSON.stringify(data),
- })
- .then((response)=>response.json())
- // return efunRequest.getHttpRequest().url(`http://ott80test-base.yifangjiaoyu.cn/mobile/favorites`).header({
- // "Accept" : "application/json",
- // "Content-Type" : "application/json",
- // "uid": ""
- // }).data(data).post();
- }
- // 获取是否收藏
- static getisFavorites(data) {
- return fetch(`http://ott80test-base.yifangjiaoyu.cn/mobile/favorites/isFavorites`,{
- method:"POST",
- headers:{
- "Accept": "application/json",
- "Content-Type": "application/json",
- "uid": ""
- },
- body: JSON.stringify(data),
- })
- .then((response)=>response.json())
- }
- // 写评论
- static addCommentList(data) {
- return fetch(`http://ott80test-base.yifangjiaoyu.cn/mobile/posts`,{
- method:"POST",
- headers:{
- "Accept": "application/json",
- "Content-Type": "application/json",
- "uid": ""
- },
- body: JSON.stringify(data),
- })
- .then((response)=>response.json())
- // return efunRequest.getHttpRequest().url(`http://ott80test-base.yifangjiaoyu.cn/mobile/posts`).header({
- // "Accept" : "application/json",
- // "Content-Type" : "application/json",
- // "uid": ""
- // }).data(data).post();
- }
- // 输入评论
- static addReplyList(data) {
- return fetch(`http://ott80test-base.yifangjiaoyu.cn/mobile/posts/reply`,{
- method:"POST",
- headers:{
- "Accept": "application/json",
- "Content-Type": "application/json",
- "uid": ""
- },
- body: JSON.stringify(data),
- })
- .then((response)=>response.json())
- // return efunRequest.getHttpRequest().url(`http://ott80test-base.yifangjiaoyu.cn/mobile/posts`).header({
- // "Accept" : "application/json",
- // "Content-Type" : "application/json",
- // "uid": ""
- // }).data(data).post();
- }
- }
|