import type { Metadata } from 'next'; import Link from 'next/link'; import { notFound } from 'next/navigation'; import { publicApi } from '@/lib/services'; import { resolveUploadUrl } from '@/lib/utils'; import { ContentView } from '@/components/front/ContentView'; export const revalidate = 60; interface PageProps { params: { id: string }; } export async function generateMetadata({ params }: PageProps): Promise { try { const p = await publicApi.getProductDetail(Number(params.id)); return { title: p.name, description: p.desc ?? undefined }; } catch { return { title: '产品详情' }; } } export default async function ProductDetailPage({ params }: PageProps) { let product; try { product = await publicApi.getProductDetail(Number(params.id)); } catch { notFound(); } return (
{/* eslint-disable-next-line @next/next/no-img-element */} {product.name}

{product.name}

{product.category?.name && ( {product.category.name} )} {product.desc && (

{product.desc}

)}
{product.content && ( )}
); }