mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 23:20:28 +08:00
feat: dynamic config
This commit is contained in:
17
app/page.tsx
17
app/page.tsx
@@ -1,27 +1,14 @@
|
||||
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() {
|
||||
export default async function App() {
|
||||
return (
|
||||
<>
|
||||
<div style={{ display: "none" }} id={RUNTIME_CONFIG_DOM}>
|
||||
{JSON.stringify(DANGER_CONFIG)}
|
||||
</div>
|
||||
<Home />
|
||||
{serverConfig?.isVercel && <Analytics />}
|
||||
</>
|
||||
|
Reference in New Issue
Block a user