fix(route): leiphone bugs (#8939)

This commit is contained in:
QieSen
2022-02-02 22:19:51 +08:00
committed by GitHub
parent c9d8450688
commit 6ad33ad744
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -2107,7 +2107,7 @@ column 为 third 时可选的 category:
### 栏目
<Route author="vlcheng" example="/leiphone/category/industrynews" path="/leiphone/category/industrynews/:catname" :paramsDesc="['网站顶部分类栏目']">
<Route author="vlcheng" example="/leiphone/category/industrynews" path="/leiphone/category/:catname" :paramsDesc="['网站顶部分类栏目']">
- 主栏目
+1 -1
View File
@@ -6,7 +6,7 @@ module.exports = async (ctx) => {
const todo = ctx.params.do ?? '';
const keyword = ctx.params.keyword ?? '';
const rootUrl = 'https://www.leiphone.com';
const url = `${rootUrl}${todo}${keyword}`;
const url = `${rootUrl}/${todo}/${keyword}`;
const res = await got.get(url);
const $ = cheerio.load(res.data);
+1 -1
View File
@@ -7,7 +7,7 @@ module.exports = async (ctx) => {
const res = await got.get(url);
const article = (res.data || {}).article || [];
const list = article.map((item) => item.url);
const list = article.map((item) => (item.url));
const items = await utils.ProcessFeed(list, ctx.cache);
ctx.state.data = {
+1 -1
View File
@@ -11,7 +11,7 @@ module.exports = {
{
title: '栏目',
docs: 'https://docs.rsshub.app/new-media.html#lei-feng-wang-lan-mu',
source: ['/:catename'],
source: ['/category/:catename'],
target: '/leiphone/category/:catname',
},
{
+1 -1
View File
@@ -1,4 +1,4 @@
module.exports = function (router) {
router.get('/:do?/:keyword?', require('./index'));
router.get('/newsflash', require('./newsflash'));
router.get('/:do?/:keyword?', require('./index'));
};