fix(route): FT route conflict (#15649)

* fix: FT route conflict

closes #15641

* fix: param
This commit is contained in:
Henry Wang
2024-05-22 03:36:24 +08:00
committed by GitHub
parent b259388acf
commit f8ad03ea29
4 changed files with 12 additions and 6 deletions
+1 -1
View File
@@ -2,5 +2,5 @@ import type { Namespace } from '@/types';
export const namespace: Namespace = {
name: 'Financial Times',
url: 'ftchinese.com',
url: 'ft.com',
};
@@ -4,8 +4,8 @@ import utils from './utils';
export const route: Route = {
path: '/:language/:channel?',
categories: ['traditional-media'],
example: '/ft/chinese/hotstoryby7day',
parameters: { language: '语言,简体`chinese`,繁体`traditional`', channel: '频道,缺省为每日更新' },
example: '/ft/simplified/hotstoryby7day',
parameters: { language: '语言,简体 `simplified`,繁体 `traditional`', channel: '频道,缺省为每日更新' },
features: {
requireConfig: false,
requirePuppeteer: false,
@@ -25,13 +25,13 @@ export const route: Route = {
支持所有频道,频道名称见 [官方频道 RSS](http://www.ftchinese.com/channel/rss.html).
- 频道为单一路径,如 \`http://www.ftchinese.com/rss/news\` 则为 \`/ft/chinese/news\`.
- 频道包含多重路径,如 \`http://www.ftchinese.com/rss/column/007000002\` 则替换 \`/\` 为 \`-\` \`/ft/chinese/column-007000002\`.`,
- 频道为单一路径,如 \`http://www.ftchinese.com/rss/news\` 则为 \`/ft/simplified/news\`.
- 频道包含多重路径,如 \`http://www.ftchinese.com/rss/column/007000002\` 则替换 \`/\` 为 \`-\` \`/ft/simplified/column-007000002\`.`,
};
async function handler(ctx) {
return await utils.getData({
site: ctx.req.param('language') === 'chinese' ? 'www' : 'big5',
site: ctx.req.param('language') === 'simplified' ? 'www' : 'big5',
channel: ctx.req.param('channel'),
ctx,
});
+6
View File
@@ -0,0 +1,6 @@
import type { Namespace } from '@/types';
export const namespace: Namespace = {
name: 'FT 中文网',
url: 'ftchinese.com',
};