website-01/app/(front)/layout.tsx

30 lines
714 B
TypeScript
Raw Permalink Normal View History

2026-06-22 14:43:46 +08:00
import { ReactNode } from 'react';
import { Header } from '@/components/front/Header';
import { Footer } from '@/components/front/Footer';
import { publicApi } from '@/lib/services';
export const revalidate = 60; // ISR60 秒重新生成
async function getConfig() {
try {
return await publicApi.getSiteConfig();
} catch {
return null;
}
}
export default async function FrontLayout({
children,
}: {
children: ReactNode;
}) {
const config = await getConfig();
return (
<div className="flex min-h-screen flex-col">
<Header siteName={config?.siteName ?? '企业官方网站'} />
<main className="flex-1">{children}</main>
<Footer config={config} />
</div>
);
}