mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-06 09:26:45 +08:00
70 lines
1.4 KiB
JavaScript
70 lines
1.4 KiB
JavaScript
import ajax from '@/utils/xajax.js'
|
|
|
|
|
|
/**
|
|
* 首页推荐案例
|
|
* @param type 2最热 1最新
|
|
* */
|
|
const cases=function (type){
|
|
return ajax.get('/xboe/portal/index/cases?type='+type);
|
|
}
|
|
|
|
/**
|
|
* 首页文章排行榜
|
|
* @param num 条数 不传默认5条
|
|
* */
|
|
const articleViews=function (num){
|
|
return ajax.get('/xboe/portal/index/article-views?num='+num);
|
|
}
|
|
|
|
/**
|
|
* 首页问答排行榜
|
|
* @param num 条数 不传默认5条
|
|
* */
|
|
const qaAnswers=function (num){
|
|
return ajax.get('/xboe/portal/index/qa-answers?num='+num);
|
|
}
|
|
|
|
/**
|
|
* 1最新 2最热
|
|
* */
|
|
const articlelist=function (type){
|
|
return ajax.get('/xboe/portal/index/articlelist?type='+type);
|
|
}
|
|
|
|
/**
|
|
* 首页课程排行榜
|
|
* 参数和原接口一样,只需要换接口名称就可以
|
|
* */
|
|
const courselist=function (data){
|
|
return ajax.post('/xboe/portal/index/courselist',data);
|
|
}
|
|
// 移动端首页课程
|
|
const mobileIndex=function(data){return ajax.post('/xboe/portal/index/mobile-courseindex',data);}
|
|
/*
|
|
评分榜
|
|
@param num 要几条传几条 不传默认五条
|
|
*/
|
|
const scorelist=function(num,p){
|
|
return ajax.get(`/xboe/m/course/portal/score-list?num=${num}&index=${p}`);
|
|
}
|
|
/**首页查询问答
|
|
* pageSize
|
|
* orderField
|
|
* orderAsc
|
|
*/
|
|
const indexList=function(query) {
|
|
return ajax.post('/xboe/m/qa/question/query-random',query);
|
|
}
|
|
|
|
export default {
|
|
cases,
|
|
articleViews,
|
|
qaAnswers,
|
|
articlelist,
|
|
courselist,
|
|
mobileIndex,
|
|
scorelist,
|
|
indexList
|
|
}
|