fix(route): /3dmgame/news (#14904)

This commit is contained in:
lyqluis
2024-03-22 13:30:10 +08:00
committed by GitHub
parent b099004574
commit e17044324b
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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,
};
+2 -2
View File
@@ -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')