From 88a594eea66c18c4b80401ebd0349652dd76db5a Mon Sep 17 00:00:00 2001 From: Tony Date: Wed, 21 Feb 2024 22:26:51 +0800 Subject: [PATCH] fix(route): hitwh (#14519) --- lib/v2/hitwh/today.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/v2/hitwh/today.js b/lib/v2/hitwh/today.js index 245213c19..c21251c35 100644 --- a/lib/v2/hitwh/today.js +++ b/lib/v2/hitwh/today.js @@ -6,7 +6,11 @@ const timezone = require('@/utils/timezone'); const baseUrl = 'https://today.hitwh.edu.cn'; module.exports = async (ctx) => { - const response = await got(`${baseUrl}/1024/list.htm`); + const response = await got(`${baseUrl}/1024/list.htm`, { + https: { + rejectUnauthorized: false, + }, + }); const $ = cheerio.load(response.data); const type = (filename) => filename.split('.').pop(); const links = $('.list_list_wrap #wp_news_w10002 ul > li') @@ -25,7 +29,11 @@ module.exports = async (ctx) => { ctx.cache.tryGet(item.link, async () => { if (type(item.link) === 'htm') { try { - const { data } = await got(item.link); + const { data } = await got(item.link, { + https: { + rejectUnauthorized: false, + }, + }); const $ = cheerio.load(data); item.description = $('div.wp_articlecontent').html() && $('div.wp_articlecontent').html().replaceAll('src="/', `src="${baseUrl}/`).replaceAll('href="/', `href="${baseUrl}/`).trim(); return item;