From 8e54b7cc7687be36cb78f771e740828b54fd250c Mon Sep 17 00:00:00 2001 From: Chenyang Shi Date: Fri, 22 Feb 2019 14:57:57 +0800 Subject: [PATCH] =?UTF-8?q?=20fix=20=E6=8E=98=E9=87=91=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=90=A6=E6=8A=93=E5=8F=96=E5=85=A8=E6=96=87?= =?UTF-8?q?=20(#1600)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update bug report template * fix 掘金没有判断否抓取全文 --- lib/routes/juejin/utils.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/routes/juejin/utils.js b/lib/routes/juejin/utils.js index f29e19bb06..05b692b124 100644 --- a/lib/routes/juejin/utils.js +++ b/lib/routes/juejin/utils.js @@ -40,12 +40,15 @@ const ProcessFeed = async (list, caches) => guid: item.originalUrl, }; - // 使用tryGet方法从缓存获取内容。 - // 当缓存中无法获取到链接内容的时候,则使用load方法加载文章内容。 - const other = await caches.tryGet(item.originalUrl, async () => await load(item.originalUrl)); - - // 合并解析后的结果集作为该篇文章最终的输出结果 - return Promise.resolve(Object.assign({}, single, other)); + if (item.type === 'post') { + // 使用tryGet方法从缓存获取内容。 + // 当缓存中无法获取到链接内容的时候,则使用load方法加载文章内容。 + const other = await caches.tryGet(item.originalUrl, async () => await load(item.originalUrl)); + // 合并解析后的结果集作为该篇文章最终的输出结果 + return Promise.resolve(Object.assign({}, single, other)); + } else { + return Promise.resolve(single); + } }) );