fix(route): 更新苏州市政府新闻栏目 (#9119)
新闻栏目新增便民公告 新闻栏目名称、顺序、链接与苏州市政府官网保持一致 改用https 更新文档,由于栏目过长改为竖排
This commit is contained in:
parent
1aa3556639
commit
cfe185e58c
|
|
@ -306,11 +306,35 @@ pageClass: routes
|
|||
|
||||
### 政府新闻
|
||||
|
||||
<Route author="EsuRt luyuhuang" example="/gov/suzhou/news/news" path="/gov/suzhou/news/:uid" :paramsDesc="['分类名']">
|
||||
<Route author="EsuRt luyuhuang" example="/gov/suzhou/news/news" path="/gov/suzhou/news/:uid" :paramsDesc="['栏目名']">
|
||||
|
||||
| 政务要闻 | 区县快讯 | 部门动态 | 新闻视频 | 热点专题 | 市本级专题 | 最新热点专题 | 往期专题 | 区县专题 | 政务公告 | 便民资讯 |
|
||||
| :------: | :------: | :------: | :------: | :------: | :--------: | :----------: | :------: | :------: | :------: | :------: |
|
||||
| news | district | bmdt | xwsp | rdzt | sbjzt | zxrdzt | wqzt | qxzt | zwgg | bmzx |
|
||||
| 新闻栏目名 | :uid |
|
||||
| :------: | :--: |
|
||||
| 苏州要闻 | news 或 szyw |
|
||||
| 区县快讯 | district 或 qxkx |
|
||||
| 部门动态 | bmdt |
|
||||
| 新闻视频 | xwsp |
|
||||
| 政务公告 | zwgg |
|
||||
| 便民公告 | mszx |
|
||||
| 民生资讯 | bmzx |
|
||||
|
||||
| 热点专题栏目名 | :uid |
|
||||
| :------: | :--: |
|
||||
| 热点专题 | rdzt |
|
||||
| 市本级专题 | sbjzt |
|
||||
| 最新热点专题 | zxrdzt |
|
||||
| 往期专题 | wqzt |
|
||||
| 区县专题 | qxzt |
|
||||
|
||||
::: tip 提示
|
||||
|
||||
**热点专题**栏目包含**市本级专题**和**区县专题**
|
||||
|
||||
**市本级专题**栏目包含**最新热点专题**和**往期专题**
|
||||
|
||||
如需订阅完整的热点专题,仅需订阅 **热点专题**`rdzt` 一项即可。
|
||||
|
||||
:::
|
||||
|
||||
</Route>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ const got = require('@/utils/got');
|
|||
const cheerio = require('cheerio');
|
||||
const util = require('./utils');
|
||||
module.exports = async (ctx) => {
|
||||
const link = 'http://www.suzhou.gov.cn/szxxgk/front/xxgk_right.jsp';
|
||||
const link = 'https://www.suzhou.gov.cn/szxxgk/front/xxgk_right.jsp';
|
||||
const response = await got.get(link);
|
||||
const data = response.data;
|
||||
const $ = cheerio.load(data);
|
||||
|
|
@ -17,7 +17,7 @@ module.exports = async (ctx) => {
|
|||
.map(async (index, item) => {
|
||||
item = $(item);
|
||||
// 获取全文
|
||||
const contentUrl = 'http://www.suzhou.gov.cn' + item.find('a').attr('href');
|
||||
const contentUrl = 'https://www.suzhou.gov.cn' + item.find('a').attr('href');
|
||||
const arr = await ctx.cache.tryGet(contentUrl, async () => {
|
||||
const fullText = await got.get(contentUrl);
|
||||
const fullTextData = cheerio.load(fullText.data);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ const cheerio = require('cheerio');
|
|||
const logger = require('@/utils/logger');
|
||||
const liburl = require('url');
|
||||
const util = require('./utils');
|
||||
const root_url = 'http://www.suzhou.gov.cn/';
|
||||
const root_url = 'https://www.suzhou.gov.cn/';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const uid = ctx.params.uid;
|
||||
|
|
@ -11,57 +11,62 @@ module.exports = async (ctx) => {
|
|||
let title = '';
|
||||
let urljs = '';
|
||||
switch (uid) {
|
||||
case 'qxkx':
|
||||
case 'district':
|
||||
urljs = 'http://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=75c636ea0efb487ea7e479e3cc0ff3e5';
|
||||
url = 'http://www.suzhou.gov.cn/szsrmzf/zwggqxkx/nav_list_js.shtml';
|
||||
title = '苏州市政府 - 区县快讯';
|
||||
break;
|
||||
case 'szyw':
|
||||
case 'news':
|
||||
urljs = 'http://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=5057aeffb1a84a7e8aeded87728da48c';
|
||||
url = 'http://www.suzhou.gov.cn/szsrmzf/szyw/nav_list_js.shtml';
|
||||
title = '苏州市政府 - 政务要闻';
|
||||
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=5057aeffb1a84a7e8aeded87728da48c';
|
||||
url = 'https://www.suzhou.gov.cn/szsrmzf/szyw/nav_list.shtml';
|
||||
title = '苏州市政府 - 苏州要闻';
|
||||
break;
|
||||
case 'qxkx':
|
||||
case 'district':
|
||||
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=75c636ea0efb487ea7e479e3cc0ff3e5';
|
||||
url = 'https://www.suzhou.gov.cn/szsrmzf/qxkx/nav_list.shtml';
|
||||
title = '苏州市政府 - 区县快讯';
|
||||
break;
|
||||
case 'bmdt':
|
||||
urljs = 'http://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=b3d097e3eb79421f88439ea381ce33c3';
|
||||
url = 'http://www.suzhou.gov.cn/szsrmzf/bmdt/nav_list_js.shtml';
|
||||
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=b3d097e3eb79421f88439ea381ce33c3';
|
||||
url = 'https://www.suzhou.gov.cn/szsrmzf/bmdt/nav_list.shtml';
|
||||
title = '苏州市政府 - 部门动态';
|
||||
break;
|
||||
case 'xwsp':
|
||||
urljs = 'http://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=507980d214c943ebb0a70853ec94b12e';
|
||||
url = 'http://www.suzhou.gov.cn/szsrmzf/xwsp/nav_list_js.shtml';
|
||||
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=507980d214c943ebb0a70853ec94b12e';
|
||||
url = 'https://www.suzhou.gov.cn/szsrmzf/xwsp/nav_list.shtml';
|
||||
title = '苏州市政府 - 新闻视频';
|
||||
break;
|
||||
case 'rdzt':
|
||||
url = 'http://www.suzhou.gov.cn/szsrmzf/rdzt/nav_list.shtml';
|
||||
url = 'https://www.suzhou.gov.cn/szsrmzf/rdzt/nav_list.shtml';
|
||||
title = '苏州市政府 - 热点专题';
|
||||
break;
|
||||
case 'sbjzt':
|
||||
url = 'http://www.suzhou.gov.cn/szsrmzf/sbjzt/nav_list.shtml';
|
||||
url = 'https://www.suzhou.gov.cn/szsrmzf/sbjzt/nav_list.shtml';
|
||||
title = '苏州市政府 - 市本级专题';
|
||||
break;
|
||||
case 'zxrdzt':
|
||||
url = 'http://www.suzhou.gov.cn/szsrmzf/zxrdzt/nav_list.shtml';
|
||||
url = 'https://www.suzhou.gov.cn/szsrmzf/zxrdzt/nav_list.shtml';
|
||||
title = '苏州市政府 - 最新热点专题';
|
||||
break;
|
||||
case 'wqzt':
|
||||
url = 'http://www.suzhou.gov.cn/szsrmzf/wqzt/nav_list.shtml';
|
||||
url = 'https://www.suzhou.gov.cn/szsrmzf/wqzt/nav_list.shtml';
|
||||
title = '苏州市政府 - 往期专题';
|
||||
break;
|
||||
case 'qxzt':
|
||||
url = 'http://www.suzhou.gov.cn/szsrmzf/qxzt/nav_list.shtml';
|
||||
url = 'https://www.suzhou.gov.cn/szsrmzf/qxzt/nav_list.shtml';
|
||||
title = '苏州市政府 - 区县专题';
|
||||
break;
|
||||
case 'zwgg':
|
||||
urljs = 'http://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=260915178a1f4c4fac44c4bf6378c9b0';
|
||||
url = 'http://www.suzhou.gov.cn/szsrmzf/zwgg/nav_list_js.shtml';
|
||||
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=260915178a1f4c4fac44c4bf6378c9b0';
|
||||
url = 'https://www.suzhou.gov.cn/szsrmzf/zwgg/nav_list.shtml';
|
||||
title = '苏州市政府 - 政务公告';
|
||||
break;
|
||||
case 'mszx':
|
||||
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=dc60acecb0be46b89d42272dcb8bd32b';
|
||||
url = 'https://www.suzhou.gov.cn/szsrmzf/mszx/nav_list.shtml';
|
||||
title = '苏州市政府 - 便民公告';
|
||||
break;
|
||||
case 'bmzx':
|
||||
urljs = 'http://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=b015bfa5e5514cc9a26cd9f956ef8e69';
|
||||
url = 'http://www.suzhou.gov.cn/szsrmzf/bmdt/nav_list_js.shtml';
|
||||
title = '苏州市政府 - 便民资讯';
|
||||
urljs = 'https://www.suzhou.gov.cn/szinf/info/getInfoCommon/?pagesize=15&currpage=1&channelid=b015bfa5e5514cc9a26cd9f956ef8e69';
|
||||
url = 'https://www.suzhou.gov.cn/szsrmzf/bmzx/bmzx_list.shtml';
|
||||
title = '苏州市政府 - 民生资讯';
|
||||
break;
|
||||
default:
|
||||
logger.error('pattern not matched');
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ const content = (response) => {
|
|||
.html()
|
||||
.replace(/<.?ucaptitle>/g, '')
|
||||
.replace(/<.?ucapcontent>/g, '')
|
||||
.replace(/"\/szsrmzf/g, '"http://www.suzhou.gov.cn/szsrmzf')
|
||||
.replace(/"\/szsrmzf/g, '"https://www.suzhou.gov.cn/szsrmzf')
|
||||
.replace('publishtime', 'span');
|
||||
return content;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue