This commit is contained in:
parent
ba89b18bce
commit
52a445cff1
|
|
@ -10,6 +10,7 @@ import { Inter } from "next/font/google"
|
|||
import { cookies } from "next/headers"
|
||||
import { ReactNode } from "react"
|
||||
import "./globals.css"
|
||||
import { getRuntimeEnv } from "@/lib/ipconfig" // 新增引入
|
||||
|
||||
const inter = Inter({ subsets: ["latin"] })
|
||||
const APP_NAME = "ChatAI UI"
|
||||
|
|
@ -24,42 +25,6 @@ interface RootLayoutProps {
|
|||
}
|
||||
}
|
||||
|
||||
// export const metadata: Metadata = {
|
||||
// applicationName: APP_NAME,
|
||||
// title: {
|
||||
// default: APP_DEFAULT_TITLE,
|
||||
// template: APP_TITLE_TEMPLATE
|
||||
// },
|
||||
// description: APP_DESCRIPTION,
|
||||
// manifest: "/manifest.json",
|
||||
// appleWebApp: {
|
||||
// capable: true,
|
||||
// statusBarStyle: "black",
|
||||
// title: APP_DEFAULT_TITLE
|
||||
// // startUpImage: [],
|
||||
// },
|
||||
// formatDetection: {
|
||||
// telephone: false
|
||||
// },
|
||||
// openGraph: {
|
||||
// type: "website",
|
||||
// siteName: APP_NAME,
|
||||
// title: {
|
||||
// default: APP_DEFAULT_TITLE,
|
||||
// template: APP_TITLE_TEMPLATE
|
||||
// },
|
||||
// description: APP_DESCRIPTION
|
||||
// },
|
||||
// twitter: {
|
||||
// card: "summary",
|
||||
// title: {
|
||||
// default: APP_DEFAULT_TITLE,
|
||||
// template: APP_TITLE_TEMPLATE
|
||||
// },
|
||||
// description: APP_DESCRIPTION
|
||||
// }
|
||||
// }
|
||||
|
||||
export async function generateMetadata({
|
||||
params: { locale }
|
||||
}: {
|
||||
|
|
@ -127,7 +92,7 @@ export default async function RootLayout({
|
|||
}
|
||||
|
||||
const supabase = createServerClient<Database>(
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
||||
getRuntimeEnv("SUPABASE_URL") ?? "http://localhost:8000",
|
||||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
||||
{
|
||||
cookies: {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
// lib/ipconfig.ts
|
||||
export function getRuntimeEnv(key: string): string | undefined {
|
||||
if (typeof window !== "undefined" && typeof window.RUNTIME_ENV !== "undefined") {
|
||||
return window.RUNTIME_ENV[key];
|
||||
}
|
||||
return process.env[key];
|
||||
}
|
||||
Loading…
Reference in New Issue