mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 19:52:27 +08:00
refactor: build/runtime/client configs
This commit is contained in:
19
app/page.tsx
19
app/page.tsx
@@ -1,12 +1,29 @@
|
||||
import { Analytics } from "@vercel/analytics/react";
|
||||
|
||||
import { Home } from "./components/home";
|
||||
import { getServerSideConfig } from "./config/server";
|
||||
import { RUNTIME_CONFIG_DOM } from "./constant";
|
||||
|
||||
const serverConfig = getServerSideConfig();
|
||||
|
||||
// Danger! Don not write any secret value here!
|
||||
// 警告!不要在这里写入任何敏感信息!
|
||||
const DANGER_CONFIG = {
|
||||
needCode: serverConfig?.needCode,
|
||||
};
|
||||
|
||||
declare global {
|
||||
type DangerConfig = typeof DANGER_CONFIG;
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<>
|
||||
<div style={{ display: "none" }} id={RUNTIME_CONFIG_DOM}>
|
||||
{JSON.stringify(DANGER_CONFIG)}
|
||||
</div>
|
||||
<Home />
|
||||
<Analytics />
|
||||
{serverConfig?.isVercel && <Analytics />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user