diff --git a/lib/routes/initium/full.js b/lib/routes/initium/full.js index 8cb5d51919..ea8cdeeb4f 100644 --- a/lib/routes/initium/full.js +++ b/lib/routes/initium/full.js @@ -157,17 +157,20 @@ module.exports = async (ctx) => { }; const items = await Promise.all( - articles.slice(0, token === 'Basic YW5vbnltb3VzOkdpQ2VMRWp4bnFCY1ZwbnA2Y0xzVXZKaWV2dlJRY0FYTHY=' && key.iapReceipt === undefined ? 10 : articles.length).map(async (item) => ({ - title: item.article.headline, - author: item.article.authors.length > 0 ? item.article.authors.map((x) => x.name).toString() : item.article.byline, - category: item.article.channels.filter((x) => !x.homepage).map((x) => x.name), - description: await getFullText(item.article.slug), - link: resolve_url('https://theinitium.com', item.article.url), - pubDate: item.article.date, - updated: item.article.updated, - // 如果遇到编辑部漏录入情况,则给uuid做个手脚,以便阅读器到时重抓。 - guid: (await getFullText(item.article.slug)).endsWith('内容为空,请稍后再来') ? item.article.uuid + '-I-am-empty' : item.article.uuid, - })) + articles + .filter((a) => a.article) + .slice(0, token === 'Basic YW5vbnltb3VzOkdpQ2VMRWp4bnFCY1ZwbnA2Y0xzVXZKaWV2dlJRY0FYTHY=' && key.iapReceipt === undefined ? 10 : articles.length) + .map(async (item) => ({ + title: item.article.headline, + author: item.article.authors.length > 0 ? item.article.authors.map((x) => x.name).toString() : item.article.byline, + category: item.article.channels.filter((x) => !x.homepage).map((x) => x.name), + description: await getFullText(item.article.slug), + link: resolve_url('https://theinitium.com', item.article.url), + pubDate: item.article.date, + updated: item.article.updated, + // 如果遇到编辑部漏录入情况,则给uuid做个手脚,以便阅读器到时重抓。 + guid: (await getFullText(item.article.slug)).endsWith('内容为空,请稍后再来') ? item.article.uuid + '-I-am-empty' : item.article.uuid, + })) ); ctx.state.data = {