Skip to content

Commit

Permalink
🐞 fix: 修复启动异常
Browse files Browse the repository at this point in the history
  • Loading branch information
imsyy committed Dec 4, 2024
1 parent 098b808 commit 0cce0d6
Show file tree
Hide file tree
Showing 21 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dev": "cross-env NODE_ENV=development tsx watch --no-cache src/index.ts",
"dev:cache": "cross-env NODE_ENV=development tsx watch src/index.ts",
"build": "tsc --project tsconfig.json",
"start": "cross-env NODE_ENV=development tsx dist/index.js"
"start": "cross-env NODE_ENV=development tsx dist/src/index.js"
},
"type": "module",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ app.get("/all", (c) =>
if (excludeRoutes.includes(path)) {
return {
name: path,
path: null,
path: undefined,
message: "该接口暂时下线",
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/bilibili.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const getList = async (options: Options, noCache: boolean): Promise<RouterResTyp
desc: v.desc || "该视频暂无简介",
cover: v.pic?.replace(/http:/, "https:"),
author: v.author,
timestamp: null,
timestamp: undefined,
hot: v.video_review,
url: `https://www.bilibili.com/video/${v.bvid}`,
mobileUrl: `https://m.bilibili.com/video/${v.bvid}`,
Expand Down
4 changes: 2 additions & 2 deletions src/routes/csdn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const getList = async (noCache: boolean): Promise<RouterResType> => {
data: list.map((v: RouterType["csdn"]) => ({
id: v.productId,
title: v.articleTitle,
cover: v.picList?.[0] || null,
desc: null,
cover: v.picList?.[0] || undefined,
desc: undefined,
author: v.nickName,
timestamp: getTime(v.period),
hot: Number(v.hotRankScore),
Expand Down
2 changes: 1 addition & 1 deletion src/routes/douyin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const getDyCookies = async () => {
return cookieData;
} catch (error) {
console.error("获取抖音 Cookie 出错" + error);
return null;
return undefined;
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/routes/genshin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const getList = async (options: Options, noCache: boolean) => {
title: data.subject,
desc: data.content,
cover: data.cover || data?.images?.[0],
author: v.user?.nickname || null,
author: v.user?.nickname || undefined,
timestamp: getTime(data.created_at),
hot: data.view_status,
url: `https://www.miyoushe.com/ys/article/${data.post_id}`,
Expand Down
6 changes: 3 additions & 3 deletions src/routes/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ const getList = async (options: Options, noCache: boolean) => {
data: list.map((v: RouterType["history"], index: number) => ({
id: index,
title: load(v.title).text().trim(),
cover: v.cover ? v.pic_share : null,
cover: v.cover ? v.pic_share : undefined,
desc: load(v.desc).text().trim(),
year: v.year,
timestamp: null,
hot: null,
timestamp: undefined,
hot: undefined,
url: v.link,
mobileUrl: v.link,
})),
Expand Down
2 changes: 1 addition & 1 deletion src/routes/honkai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const getList = async (options: Options, noCache: boolean) => {
title: data.subject,
desc: data.content,
cover: data.cover || data?.images?.[0],
author: v.user?.nickname || null,
author: v.user?.nickname || undefined,
timestamp: getTime(data.created_at),
hot: data.view_status,
url: `https://www.miyoushe.com/bh3/article/${data.post_id}`,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/hupu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const getList = async (options: Options, noCache: boolean) => {
title: v.title,
author: v.username,
hot: v.replies,
timestamp: null,
timestamp: undefined,
url: `https://bbs.hupu.com/${v.tid}.html`,
mobileUrl: v.url,
})),
Expand Down
2 changes: 1 addition & 1 deletion src/routes/huxiu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const getList = async (noCache: boolean) => {
desc: titleProcessing(v.content).intro,
author: v.user_info.username,
timestamp: getTime(v.publish_time),
hot: null,
hot: undefined,
url: v.url || `https://www.huxiu.com/moment/${v.object_id}.html`,
mobileUrl: v.url || `https://m.huxiu.com/moment/${v.object_id}.html`,
})),
Expand Down
2 changes: 1 addition & 1 deletion src/routes/ithome-xijiayi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const getList = async (noCache: boolean) => {
const href = dom.find("a").attr("href");
const time = dom.find("span.time").text().trim();
const match = time.match(/'([^']+)'/);
const dateTime = match ? match[1] : null;
const dateTime = match ? match[1] : undefined;
return {
id: href ? Number(replaceLink(href, true)) : 100000,
title: dom.find(".newsbody h2").text().trim(),
Expand Down
2 changes: 1 addition & 1 deletion src/routes/miyoushe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const getList = async (options: Options, noCache: boolean): Promise<RouterResTyp
title: data.subject,
desc: data.content,
cover: data.cover || data?.images?.[0],
author: v.user?.nickname || null,
author: v.user?.nickname || undefined,
timestamp: getTime(data.created_at),
hot: data.view_status || 0,
url: `https://www.miyoushe.com/ys/article/${data.post_id}`,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/netease-news.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const getList = async (noCache: boolean) => {
title: v.title,
cover: v.imgsrc,
author: v.source,
hot: null,
hot: undefined,
timestamp: getTime(v.ptime),
url: `https://www.163.com/dy/article/${v.docid}.html`,
mobileUrl: `https://m.163.com/dy/article/${v.docid}.html`,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/sina-news.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const getList = async (options: Options, noCache: boolean) => {
data: list.map((v: RouterType["sina-news"]) => ({
id: v.id,
title: v.title,
author: v.media || null,
author: v.media || undefined,
hot: parseFloat(v.top_num.replace(/,/g, "")),
timestamp: getTime(v.create_date + " " + v.create_time),
url: v.url,
Expand Down
6 changes: 3 additions & 3 deletions src/routes/sina.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ const getList = async (options: Options, noCache: boolean) => {
return {
id: base.base.uniqueId,
title: info.title,
desc: null,
author: null,
timestamp: null,
desc: undefined,
author: undefined,
timestamp: undefined,
hot: parseChineseNumber(info.hotValue),
url: base.base.url,
mobileUrl: base.base.url,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/starrail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const getList = async (options: Options, noCache: boolean) => {
title: data.subject,
desc: data.content,
cover: data.cover || data?.images?.[0],
author: v.user?.nickname || null,
author: v.user?.nickname || undefined,
timestamp: getTime(data.created_at),
hot: data.view_status,
url: `https://www.miyoushe.com/sr/article/${data.post_id}`,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/v2ex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const getList = async (options: Options, noCache: boolean) => {
title: v.title,
desc: v.content,
author: v.member.username,
timestamp: null,
timestamp: undefined,
hot: v.replies,
url: v.url,
mobileUrl: v.url,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/weatheralarm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const getList = async (options: Options, noCache: boolean) => {
desc: v.issuetime + " " + v.title,
cover: v.pic,
timestamp: getTime(v.issuetime),
hot: null,
hot: undefined,
url: `http://nmc.cn${v.url}`,
mobileUrl: `http://nmc.cn${v.url}`,
})),
Expand Down
6 changes: 3 additions & 3 deletions src/routes/zhihu-daily.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ const getList = async (noCache: boolean) => {
data: list.map((v: RouterType["zhihu-daily"]) => ({
id: v.id,
title: v.title,
cover: v.images?.[0] ?? null,
cover: v.images?.[0] ?? undefined,
author: v.hint,
hot: null,
timestamp: null,
hot: undefined,
timestamp: undefined,
url: v.url,
mobileUrl: v.url,
})),
Expand Down
2 changes: 1 addition & 1 deletion src/utils/getTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const getTime = (timeInput: string | number): number | undefined => {
"YYYY-MM-DD",
];

let parsedDate: dayjs.Dayjs | null = null;
let parsedDate: dayjs.Dayjs | undefined = undefined;
for (const pattern of formatPatterns) {
parsedDate = dayjs(standardizedInput, pattern, true);
if (parsedDate.isValid()) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/getToken/weread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const getWereadID = (bookId: string) => {
return strSub;
} catch (error) {
console.error("处理微信读书 ID 时出现错误:" + error);
return null;
return undefined;
}
};

Expand Down

0 comments on commit 0cce0d6

Please sign in to comment.