mirror of
https://github.com/imsyy/DailyHotApi.git
synced 2026-01-12 05:04:56 +08:00
feat: 添加gameres路由类型定义
This commit is contained in:
10
src/router.types.d.ts
vendored
10
src/router.types.d.ts
vendored
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user