From 3b37bbd1777c8a77da540b03daf3bc8dc226caed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD?= <39430235+3401797899@users.noreply.github.com> Date: Sun, 17 Mar 2024 00:17:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(route):=20=E4=B8=AD=E5=9B=BD=E6=B5=B7?= =?UTF-8?q?=E6=B4=8B=E5=A4=A7=E5=AD=A6=E6=95=99=E5=8A=A1=E5=A4=84=20(#1481?= =?UTF-8?q?0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(route): ouc/jwc * move control statement --- lib/routes/ouc/jwc.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/routes/ouc/jwc.ts b/lib/routes/ouc/jwc.ts index e5233eec4..0b101b9e9 100644 --- a/lib/routes/ouc/jwc.ts +++ b/lib/routes/ouc/jwc.ts @@ -39,7 +39,7 @@ async function handler() { const a = e.find('a'); return { title: a.attr('title'), - link: a.attr('href'), + link: a.attr('href').startsWith('http') ? a.attr('href') : 'https://jwc.ouc.edu.cn' + a.attr('href'), pubDate: parseDate(e.find('span.Article_PublishDate').text(), 'YYYY-MM-DD'), }; }); @@ -47,7 +47,7 @@ async function handler() { const out = await Promise.all( list.map((item) => cache.tryGet(item.link, async () => { - const response = await got('https://jwc.ouc.edu.cn' + item.link); + const response = await got(item.link); const $ = load(response.data); item.author = '中国海洋大学教务处'; item.description = $('.wp_articlecontent').html();