chore: split dev and production deployment env

This commit is contained in:
湛兮
2026-06-05 12:32:16 +08:00
parent 25c3c3e5c0
commit 6953f48344
8 changed files with 342 additions and 2 deletions
+12 -2
View File
@@ -1,4 +1,5 @@
import type { Metadata, Viewport } from "next";
import { connection } from "next/server";
import "./globals.css";
@@ -24,10 +25,19 @@ export const viewport: Viewport = {
themeColor: "#ffffff"
};
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
export default async function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
await connection();
const environmentLabel = process.env.APP_ENV_LABEL || "生产环境";
return (
<html lang="zh-CN">
<body>{children}</body>
<body>
<div className="environment-badge" aria-label={`当前环境:${environmentLabel}`}>
{environmentLabel}
</div>
{children}
</body>
</html>
);
}