From 8fca64860bb3d76c5df0cd096bc5323ed22949bb Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 5 Nov 2021 18:27:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8C=85=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/RecommendPosts.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/RecommendPosts.js b/components/RecommendPosts.js index 4315c25f..2bc6454e 100644 --- a/components/RecommendPosts.js +++ b/components/RecommendPosts.js @@ -20,10 +20,9 @@ function shuffleSort (arr) { const RecommendPosts = ({ currentPost, totalPosts }) => { let filteredPosts = totalPosts - const currentTag = currentPost.tags[0] - // 筛选同标签 if (currentPost.tags && currentPost.tags.length) { + const currentTag = currentPost.tags[0] filteredPosts = totalPosts.filter( post => post && post.tags && post.tags.includes(currentTag) && post.slug !== currentPost.slug )