feat: 更新PostPage组件的参数类型定义,确保params为Promise类型
All checks were successful
Push to Helm Chart Repository / build (push) Successful in 9s

This commit is contained in:
2025-09-14 23:57:24 +08:00
parent bd34cddbf3
commit 6bae6947f5

View File

@ -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 <div></div>