fix(route/apnews): replace routePath helper with direct access (#20329)

This commit is contained in:
Tony 2025-10-19 15:15:37 +08:00 committed by GitHub
parent ecd27a3223
commit f3e71025ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -1,4 +1,3 @@
import { routePath } from 'hono/route';
import { Route, ViewType } from '@/types';
import got from '@/utils/got';
import { load } from 'cheerio';
@ -38,7 +37,7 @@ export const route: Route = {
async function handler(ctx) {
const { topic = 'trending-news', nav = '' } = ctx.req.param();
const useNav = routePath(ctx) === '/apnews/nav/:nav{.*}?';
const useNav = ctx.req.routePath === '/apnews/nav/:nav{.*}?';
const url = useNav ? `${HOME_PAGE}/${nav}` : `${HOME_PAGE}/hub/${topic}`;
const response = await got(url);
const $ = load(response.data);