Skip to content

Commit

Permalink
style: auto format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and artefaritaKuniklo committed Dec 13, 2024
1 parent d0d4d3b commit 8162dd0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/routes/shu/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down
6 changes: 3 additions & 3 deletions lib/routes/shu/gs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,21 @@ 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;
}

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
})
)
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/shu/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/shu/xykd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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解析内容

Expand Down

0 comments on commit 8162dd0

Please sign in to comment.