mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-26 19:16:24 +00:00
feat: 重构PostPage组件,提取参数类型定义
This commit is contained in:
@ -3,7 +3,10 @@ import { cookies } from 'next/headers'
|
||||
import BlogPost from '@/components/blog-post/blog-post'
|
||||
|
||||
// 这个是approuter固定的传入格式,无法更改
|
||||
export default async function PostPage({ params }: { params: { id: string } }) {
|
||||
interface PostPageProps {
|
||||
params: { id: string }
|
||||
}
|
||||
export default async function PostPage({ params }: PostPageProps) {
|
||||
const cookieStore = await cookies();
|
||||
const { id } = params;
|
||||
const post = await getPostById({id, token: cookieStore.get('token')?.value || ''});
|
||||
|
Reference in New Issue
Block a user