feat: add route of 'zsnews.cn' (#5818)
This commit is contained in:
parent
1c1de6c09d
commit
eb0ec1525f
|
|
@ -791,6 +791,18 @@ category 对应的关键词有
|
|||
|
||||
</Route>
|
||||
|
||||
## 中山网
|
||||
|
||||
### 中山网新闻
|
||||
|
||||
<Route author="laampui" example="/zsnews/index/35" path="/zsnews/index/:cateid" :paramsDesc="['类别']">
|
||||
|
||||
| 35 | 36 | 37 | 38 | 39 |
|
||||
| ---- | ---- | ---- | ---- | ---- |
|
||||
| 本地 | 镇区 | 热点 | 社会 | 综合 |
|
||||
|
||||
</Route>
|
||||
|
||||
## 中時電子報
|
||||
|
||||
### 新聞
|
||||
|
|
|
|||
|
|
@ -3163,6 +3163,9 @@ router.get('/shiep/:type', require('./routes/universities/shiep/index'));
|
|||
router.get('/fjnews/:city/:limit', require('./routes/fjnews/fznews'));
|
||||
router.get('/fjnews/jjnews', require('./routes/fjnews/jjnews'));
|
||||
|
||||
// 中山网新闻
|
||||
router.get('/zsnews/index/:cateid', require('./routes/zsnews/index'));
|
||||
|
||||
// 孔夫子旧书网
|
||||
router.get('/kongfz/people/:id', require('./routes/kongfz/people'));
|
||||
router.get('/kongfz/shop/:id/:cat?', require('./routes/kongfz/shop'));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
ctx.params.cateid = ctx.params.cateid || '35';
|
||||
|
||||
const response = await got.get(`http://www.zsnews.cn/api/mobile/getlist.html?cateid=${ctx.params.cateid}`);
|
||||
|
||||
ctx.state.data = {
|
||||
title: '中山新闻',
|
||||
link: 'https://www.zsnews.cn/',
|
||||
item: response.data.map((item) => ({
|
||||
guid: item.id,
|
||||
title: item.title,
|
||||
description: item.title,
|
||||
link: item.url,
|
||||
})),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue