diff --git a/lib/v2/njxzc/home.js b/lib/v2/njxzc/home.js index 6c877f9f7f..640db5ef66 100644 --- a/lib/v2/njxzc/home.js +++ b/lib/v2/njxzc/home.js @@ -36,15 +36,19 @@ module.exports = async (ctx) => { // 使用缓存 ctx.cache.tryGet(item.link, async () => { const response = await got(item.link); - const $ = cheerio.load(response.data); - item.title = $('.arti_title').text(); - item.description = $('.wp_articlecontent') - .html() - .replace(/src="\//g, `src="${new URL('.', host).href}`) - .replace(/href="\//g, `href="${new URL('.', host).href}`) - .trim(); - item.pubDate = timezone(parseDate($('.arti_update').text().replace('发布时间:', '')), +8); - + if (response.redirectUrls.length > 0) { + item.link = response.redirectUrls[0]; + item.description = '该通知无法直接预览,请点击原文链接↑查看'; + } else { + const $ = cheerio.load(response.data); + item.title = $('.arti_title').text(); + item.description = $('.wp_articlecontent') + .html() + .replace(/src="\//g, `src="${new URL('.', host).href}`) + .replace(/href="\//g, `href="${new URL('.', host).href}`) + .trim(); + item.pubDate = timezone(parseDate($('.arti_update').text().replace('发布时间:', '')), +8); + } return item; }) )