mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 11:56:44 +08:00
首页接口
This commit is contained in:
32
src/api/phase2/index.js
Normal file
32
src/api/phase2/index.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import ajax from '@/utils/xajax.js'
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页推荐案例
|
||||||
|
* @param type 1最热 2最新
|
||||||
|
* */
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
cases,
|
||||||
|
articleViews,
|
||||||
|
qaAnswers
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user