This commit is contained in:
hailin 2025-05-18 23:55:17 +08:00
parent 705aebb011
commit 89d1617c3b
1 changed files with 7 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import { cookies } from "next/headers"
import { ReactNode } from "react" import { ReactNode } from "react"
import "./globals.css" import "./globals.css"
import { getRuntimeEnv } from "@/lib/ipconfig" // 新增引入 import { getRuntimeEnv } from "@/lib/ipconfig" // 新增引入
import Script from "next/script"
const inter = Inter({ subsets: ["latin"] }) const inter = Inter({ subsets: ["latin"] })
const APP_NAME = "ChatAI UI" const APP_NAME = "ChatAI UI"
@ -116,6 +117,12 @@ export default async function RootLayout({
return ( return (
<html lang="en" suppressHydrationWarning> <html lang="en" suppressHydrationWarning>
<head>
{/* ✅ 注入客户端运行时环境变量 */}
<Script src="/env.js" strategy="beforeInteractive" />
</head>
<body className={inter.className}> <body className={inter.className}>
<Providers attribute="class" defaultTheme="dark"> <Providers attribute="class" defaultTheme="dark">
<TranslationsProvider <TranslationsProvider