fix(route): leiphone bugs (#8939)
This commit is contained in:
+1
-1
@@ -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="['网站顶部分类栏目']">
|
||||
|
||||
- 主栏目
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
module.exports = function (router) {
|
||||
router.get('/:do?/:keyword?', require('./index'));
|
||||
router.get('/newsflash', require('./newsflash'));
|
||||
router.get('/:do?/:keyword?', require('./index'));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user