fix(swust): allow item empty (#2820)

This commit is contained in:
Artin 2019-08-11 01:06:05 +08:00 committed by DIYgod
parent 50ed42bd11
commit b34d319980
3 changed files with 3 additions and 3 deletions

View File

@ -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}`,

View File

@ -45,6 +45,7 @@ module.exports = async (ctx) => {
);
ctx.state.data = {
allowEmpty: true,
title: '西南科技大学教务处 新闻',
link: host,
description: '西南科技大学教务处 新闻',

View File

@ -51,6 +51,7 @@ module.exports = async (ctx) => {
);
ctx.state.data = {
allowEmpty: true,
title: '西南科技大学教务处 ' + info,
link: tag + tag_url,
description: `西南科技大学教务处 ${info}`,