fix(swust): allow item empty (#2820)
This commit is contained in:
parent
50ed42bd11
commit
b34d319980
|
|
@ -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}`,
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ module.exports = async (ctx) => {
|
|||
);
|
||||
|
||||
ctx.state.data = {
|
||||
allowEmpty: true,
|
||||
title: '西南科技大学教务处 新闻',
|
||||
link: host,
|
||||
description: '西南科技大学教务处 新闻',
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ module.exports = async (ctx) => {
|
|||
);
|
||||
|
||||
ctx.state.data = {
|
||||
allowEmpty: true,
|
||||
title: '西南科技大学教务处 ' + info,
|
||||
link: tag + tag_url,
|
||||
description: `西南科技大学教务处 ${info}`,
|
||||
|
|
|
|||
Loading…
Reference in New Issue