From 631ad8b6d2d4973c3d34d0108a16a5842902f9fd Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 11 Mar 2023 10:31:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=B1=8F=E8=94=BD=E5=8A=A0?= =?UTF-8?q?=E5=AF=86=E6=96=87=E7=AB=A0=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/search/[keyword]/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/search/[keyword]/index.js b/pages/search/[keyword]/index.js index f5616d5c..b1ea5bc4 100644 --- a/pages/search/[keyword]/index.js +++ b/pages/search/[keyword]/index.js @@ -122,7 +122,8 @@ async function filterByMemCache(allPosts, keyword) { const articleInfo = post.title + post.summary + tagContent + categoryContent let hit = articleInfo.toLowerCase().indexOf(keyword) > -1 let indexContent = [post.summary] - if (page && page.block) { + // 防止搜到加密文章的内容 + if (page && page.block && !post.password) { const contentIds = Object.keys(page.block) contentIds.forEach(id => { const properties = page?.block[id]?.value?.properties