From 72d6d970e1dfa392a0604b48e1d54ffd706423ef Mon Sep 17 00:00:00 2001 From: Zeno_ Date: Tue, 19 Aug 2025 02:03:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0gameres=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router.types.d.ts | 10 ++++++++++ src/routes/gameres.ts | 5 ++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/router.types.d.ts b/src/router.types.d.ts index 4f727f6..bed6b6b 100644 --- a/src/router.types.d.ts +++ b/src/router.types.d.ts @@ -431,4 +431,14 @@ export type RouterType = { name: string; }; }; + gameres: { + id: string; + title: string; + hot: number | undefined; + desc: string; + cover: string; + timestamp: number | undefined; + url: string; + mobileUrl: string; + }; }; diff --git a/src/routes/gameres.ts b/src/routes/gameres.ts index 9df17d3..cf6b561 100644 --- a/src/routes/gameres.ts +++ b/src/routes/gameres.ts @@ -2,6 +2,7 @@ import type { RouterData } from "../types.js"; import { load } from "cheerio"; import { get } from "../utils/getData.js"; import { getTime } from "../utils/getTime.js"; +import { RouterType } from "../router.types.js"; export const handleRoute = async (_: undefined, noCache: boolean) => { const listData = await getList(noCache); @@ -44,8 +45,6 @@ const getList = async (noCache: boolean) => { const timestamp = getTime(dateTime); // 热度(列表暂无评论数) - // const hotText = dom.find(".comment").text().trim(); - // const hot = Number(hotText.replace(/\D/g, "")) || 0; const hot = undefined; return { @@ -57,7 +56,7 @@ const getList = async (noCache: boolean) => { url, id: url, mobileUrl: url, - }; + } as RouterType["gameres"]; }); return {