page.tsx 722 B

1234567891011121314151617181920212223242526272829
  1. import { Analytics } from "@vercel/analytics/react";
  2. import { Home } from "./components/home";
  3. import { getServerSideConfig } from "./config/server";
  4. import { RUNTIME_CONFIG_DOM } from "./constant";
  5. const serverConfig = getServerSideConfig();
  6. // Danger! Don not write any secret value here!
  7. // 警告!不要在这里写入任何敏感信息!
  8. const DANGER_CONFIG = {
  9. needCode: serverConfig?.needCode,
  10. };
  11. declare global {
  12. type DangerConfig = typeof DANGER_CONFIG;
  13. }
  14. export default function App() {
  15. return (
  16. <>
  17. <div style={{ display: "none" }} id={RUNTIME_CONFIG_DOM}>
  18. {JSON.stringify(DANGER_CONFIG)}
  19. </div>
  20. <Home />
  21. {serverConfig?.isVercel && <Analytics />}
  22. </>
  23. );
  24. }