From cc7062d69706f9bbf55d88679fd43c0d7f0378ee Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 17:31:58 +0000 Subject: [PATCH] style: auto format --- lib/routes/shu/global.ts | 4 ++-- lib/routes/shu/gs.ts | 6 +++--- lib/routes/shu/index.ts | 2 +- lib/routes/shu/xykd.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/routes/shu/global.ts b/lib/routes/shu/global.ts index b4e91d37b..df8325799 100644 --- a/lib/routes/shu/global.ts +++ b/lib/routes/shu/global.ts @@ -74,11 +74,11 @@ async function handler(ctx) { cache.tryGet(item.link, async () => { const detailResponse = await got({ method: 'get', - url: item.link + url: item.link, }); // 获取详情页内容 const content = load(detailResponse.data); // 使用cheerio解析内容 - item.description = content('#vsb_content_2 .v_news_content').html() || '内容无法提取';// 提取内容区详情 + item.description = content('#vsb_content_2 .v_news_content').html() || '内容无法提取'; // 提取内容区详情 return item; // 返回完整的item }) diff --git a/lib/routes/shu/gs.ts b/lib/routes/shu/gs.ts index adf7a97ea..0d999d475 100644 --- a/lib/routes/shu/gs.ts +++ b/lib/routes/shu/gs.ts @@ -77,7 +77,8 @@ async function handler(ctx) { cache.tryGet(item.link, async () => { const url = new URL(item.link); // 创建 URL 对象以验证链接 // 确保链接是以正确的域名开头,并且不为空 - if (url.hostname === 'gs1.shu.edu.cn') { // 需校内访问 + if (url.hostname === 'gs1.shu.edu.cn') { + // 需校内访问 // Skip or handle differently for URLs with gs1.shu.edu.cn domain item.description = 'gs1.shu.edu.cn, 无法直接获取'; return item; @@ -85,13 +86,12 @@ async function handler(ctx) { const detailResponse = await got({ method: 'get', - url: item.link + url: item.link, }); // 获取详情页内容 const content = load(detailResponse.data); // 使用cheerio解析内容 item.description = content('#vsb_content .v_news_content').html() || item.description; - return item; // 返回完整的item }) ) diff --git a/lib/routes/shu/index.ts b/lib/routes/shu/index.ts index 2a0707822..b14b36973 100644 --- a/lib/routes/shu/index.ts +++ b/lib/routes/shu/index.ts @@ -74,7 +74,7 @@ async function handler(ctx) { cache.tryGet(item.link, async () => { const detailResponse = await got({ method: 'get', - url: item.link + url: item.link, }); const content = load(detailResponse.data); diff --git a/lib/routes/shu/xykd.ts b/lib/routes/shu/xykd.ts index 8dd2aca95..be6b7966b 100644 --- a/lib/routes/shu/xykd.ts +++ b/lib/routes/shu/xykd.ts @@ -78,7 +78,7 @@ async function handler(ctx) { cache.tryGet(item.link, async () => { const detailResponse = await got({ method: 'get', - url: item.link + url: item.link, }); // 获取详情页内容 const content = load(detailResponse.data); // 使用cheerio解析内容