From 2182620f8147294d9eb01cca02c210890cec8697 Mon Sep 17 00:00:00 2001 From: cczywyc <274230928@qq.com> Date: Sun, 24 Dec 2023 14:38:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20postIdKeys=20?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E5=9C=A8=E7=94=9F=E4=BA=A7=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=E9=83=A8=E7=BD=B2=E5=B8=A6=E6=9D=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/(main)/blog/BlogPosts.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/(main)/blog/BlogPosts.tsx b/app/(main)/blog/BlogPosts.tsx index 4ec401cc..22657646 100644 --- a/app/(main)/blog/BlogPosts.tsx +++ b/app/(main)/blog/BlogPosts.tsx @@ -13,7 +13,9 @@ export async function BlogPosts({ limit = 5 }) { if (env.VERCEL_ENV === 'development') { views = posts.map(() => Math.floor(Math.random() * 1000)) } else { - views = await redis.mget(...postIdKeys) + if (postIdKeys.length > 0) { + views = await redis.mget(...postIdKeys) + } } return (