fix(route): handle error when fetching sjtu/jwc article (#16448)
This commit is contained in:
parent
9c24b9d20d
commit
a42d44f834
|
|
@ -7,7 +7,10 @@ import { parseDate } from '@/utils/parse-date';
|
|||
const urlRoot = 'https://jwc.sjtu.edu.cn/xwtg';
|
||||
|
||||
async function getFullArticle(link) {
|
||||
const response = await got(link);
|
||||
const response = await got(link).catch(() => null);
|
||||
if (!response) {
|
||||
return null;
|
||||
}
|
||||
const $ = load(response.body);
|
||||
const content = $('.content-con');
|
||||
if (content.length === 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue