From b34d3199804da929e05fe4e2dc796b6076e19c2e Mon Sep 17 00:00:00 2001 From: Artin Date: Sun, 11 Aug 2019 01:06:05 +0800 Subject: [PATCH] fix(swust): allow item empty (#2820) --- lib/routes/universities/swust/cs.js | 4 +--- lib/routes/universities/swust/jwc_news.js | 1 + lib/routes/universities/swust/jwc_notice.js | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/routes/universities/swust/cs.js b/lib/routes/universities/swust/cs.js index 3a1a3cb3c..60d5f067a 100644 --- a/lib/routes/universities/swust/cs.js +++ b/lib/routes/universities/swust/cs.js @@ -7,9 +7,7 @@ module.exports = async (ctx) => { headers: { Referer: host, }, - responseType: 'buffer', }); - const type = ctx.params.type || 1; let info = '新闻动态'; let word = 'news'; @@ -27,7 +25,6 @@ module.exports = async (ctx) => { const response = await got_ins.get(host + word); const $ = cheerio.load(response.data); const text = $('a', '.list.list3'); - const resultItems = await Promise.all( text.toArray().map(async (item) => { const $item = $(item); @@ -72,6 +69,7 @@ module.exports = async (ctx) => { ); ctx.state.data = { + allowEmpty: true, title: `西南科技大学 计科学院 ${info}`, link: host + word, description: `西南科技大学 计科学院 ${info}`, diff --git a/lib/routes/universities/swust/jwc_news.js b/lib/routes/universities/swust/jwc_news.js index f5794596d..2bf8a1135 100644 --- a/lib/routes/universities/swust/jwc_news.js +++ b/lib/routes/universities/swust/jwc_news.js @@ -45,6 +45,7 @@ module.exports = async (ctx) => { ); ctx.state.data = { + allowEmpty: true, title: '西南科技大学教务处 新闻', link: host, description: '西南科技大学教务处 新闻', diff --git a/lib/routes/universities/swust/jwc_notice.js b/lib/routes/universities/swust/jwc_notice.js index 14e28c6e9..c5b6f1327 100644 --- a/lib/routes/universities/swust/jwc_notice.js +++ b/lib/routes/universities/swust/jwc_notice.js @@ -51,6 +51,7 @@ module.exports = async (ctx) => { ); ctx.state.data = { + allowEmpty: true, title: '西南科技大学教务处 ' + info, link: tag + tag_url, description: `西南科技大学教务处 ${info}`,