feat: 添加gameres路由类型定义

This commit is contained in:
Zeno_
2025-08-19 02:03:23 +08:00
parent 150a3d9c1e
commit 72d6d970e1
2 changed files with 12 additions and 3 deletions

10
src/router.types.d.ts vendored
View File

@@ -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;
};
};

View File

@@ -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 {