🐞 fix: 部分类型错误

- 新增 米游社 综合接口
This commit is contained in:
imsyy
2024-12-03 18:09:32 +08:00
parent afb7c7d515
commit 098b80865b
37 changed files with 1656 additions and 748 deletions

View File

@@ -21,7 +21,7 @@ export const handleRoute = async (_: undefined, noCache: boolean) => {
// 标题处理
const titleProcessing = (text: string) => {
const paragraphs = text.split("<br><br>");
const title = paragraphs.shift().replace(/。$/, "");
const title = paragraphs.shift()?.replace(/。$/, "");
const intro = paragraphs.join("<br><br>");
return { title, intro };
};
@@ -47,8 +47,8 @@ const getList = async (noCache: boolean) => {
author: v.user_info.username,
timestamp: getTime(v.publish_time),
hot: null,
url: v.url || "https://www.huxiu.com/moment/",
mobileUrl: v.url || "https://m.huxiu.com/moment/",
url: v.url || `https://www.huxiu.com/moment/${v.object_id}.html`,
mobileUrl: v.url || `https://m.huxiu.com/moment/${v.object_id}.html`,
})),
};
};