From 4153b47136a57a21283270ff75baef703a70dddb Mon Sep 17 00:00:00 2001 From: OrbitZore Date: Fri, 22 Jan 2021 03:47:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B9=96=E5=8D=97=E7=A7=91=E6=8A=80?= =?UTF-8?q?=E5=A4=A7=E5=AD=A6=20HTTPS=20=20(#6740)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add 湖南科技大学化学化工学院通知 * fix: 湖南科技大学 HTTPS --- lib/routes/universities/hnust/art/index.js | 7 ++++++- lib/routes/universities/hnust/jwc/index.js | 10 +++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/routes/universities/hnust/art/index.js b/lib/routes/universities/hnust/art/index.js index 8abbda896..5314b4262 100644 --- a/lib/routes/universities/hnust/art/index.js +++ b/lib/routes/universities/hnust/art/index.js @@ -4,7 +4,12 @@ const cheerio = require('cheerio'); module.exports = async (ctx) => { const base = 'https://art.hnust.edu.cn/ggtz/'; const link = base + 'index.htm'; - const response = await got.get(link); + const response = await got.get({ + url: link, + https: { + rejectUnauthorized: false, + }, + }); const $ = cheerio.load(response.data); const list = $('.newsList03 li'); diff --git a/lib/routes/universities/hnust/jwc/index.js b/lib/routes/universities/hnust/jwc/index.js index c179f5c0a..ed36ade6e 100644 --- a/lib/routes/universities/hnust/jwc/index.js +++ b/lib/routes/universities/hnust/jwc/index.js @@ -2,12 +2,16 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { - const base = 'http://jwc.hnust.edu.cn/gzzd2_20170827120536008171/jwk3_20170827120536008171/'; + const base = 'https://jwc.hnust.edu.cn/gzzd2_20170827120536008171/jwk3_20170827120536008171/'; const link = base + 'index.htm'; - const response = await got.get(link); + const response = await got.get({ + url: link, + https: { + rejectUnauthorized: false, + }, + }); const $ = cheerio.load(response.data); const list = $('.articleList ul li'); - ctx.state.data = { title: '湖南科技大学教务处通知', link: link,