From 6bae6947f5eb71a1ac9f3223073c4fc520fe348b Mon Sep 17 00:00:00 2001 From: Snowykami Date: Sun, 14 Sep 2025 23:57:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0PostPage=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=EF=BC=8C=E7=A1=AE=E4=BF=9Dparams=E4=B8=BAPromise?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/app/(main)/p/[id]/page.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/src/app/(main)/p/[id]/page.tsx b/web/src/app/(main)/p/[id]/page.tsx index 27466e3..e3470ab 100644 --- a/web/src/app/(main)/p/[id]/page.tsx +++ b/web/src/app/(main)/p/[id]/page.tsx @@ -3,12 +3,13 @@ import { cookies } from 'next/headers' import BlogPost from '@/components/blog-post/blog-post' // 这个是approuter固定的传入格式,无法更改 -interface PostPageProps { - params: { id: string } +interface Props { + params: Promise<{ id: string }> } -export default async function PostPage({ params }: PostPageProps) { + +export default async function PostPage({ params }: Props) { const cookieStore = await cookies(); - const { id } = params; + const { id } = await params; const post = await getPostById({id, token: cookieStore.get('token')?.value || ''}); if (!post) return
文章不存在