website-01/app/(front)/layout.tsx
2026-06-22 14:43:46 +08:00

30 lines
714 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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>
);
}