From e17044324b0eb3e2f118d7d1643422c3509dd2b9 Mon Sep 17 00:00:00 2001 From: lyqluis <39592732+lyqluis@users.noreply.github.com> Date: Fri, 22 Mar 2024 13:30:10 +0800 Subject: [PATCH] fix(route): /3dmgame/news (#14904) --- lib/routes/3dmgame/game.ts | 4 ++-- lib/routes/3dmgame/news-center.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/routes/3dmgame/game.ts b/lib/routes/3dmgame/game.ts index 765b49c64..f6bda17f8 100644 --- a/lib/routes/3dmgame/game.ts +++ b/lib/routes/3dmgame/game.ts @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { parseArticle } from './utils'; export const route: Route = { - path: '/:name/:type?', + path: '/games/:name/:type?', radar: [ { source: ['3dmgame.com/games/:name/:type'], @@ -14,7 +14,7 @@ export const route: Route = { ], name: '游戏资讯', categories: ['game'], - maintainers: ['sinchang', 'jacky2001114', 'HenryQW'], + maintainers: ['sinchang', 'jacky2001114', 'HenryQW', 'lyqluis'], handler, }; diff --git a/lib/routes/3dmgame/news-center.ts b/lib/routes/3dmgame/news-center.ts index a2d9f4396..c8b305052 100644 --- a/lib/routes/3dmgame/news-center.ts +++ b/lib/routes/3dmgame/news-center.ts @@ -25,7 +25,7 @@ export const route: Route = { }, ], name: '新闻中心', - maintainers: ['zhboner'], + maintainers: ['zhboner', 'lyqluis'], handler, description: `| 新闻推荐 | 游戏新闻 | 动漫影视 | 智能数码 | 时事焦点 | | -------- | -------- | -------- | -------- | ----------- | @@ -35,7 +35,7 @@ export const route: Route = { async function handler(ctx) { const { category = '' } = ctx.req.param(); const isArcPost = category && !isNaN(category); // https://www.3dmgame.com/news/\d+/ - const url = `https://www.3dmgame.com/${category && category !== 'news_36_1' ? 'news/' : ''}${category ?? 'news'}/`; + const url = `https://www.3dmgame.com/${category === 'news_36_1' ? category : 'news/' + category}`; const res = await got(url); const $ = load(res.data); const list = $(isArcPost ? '.selectarcpost' : '.selectpost')