This commit is contained in:
hailin 2025-05-21 12:07:24 +08:00
parent 82c96338f7
commit 6f7ffdc374
2 changed files with 9 additions and 4 deletions

View File

@ -1,11 +1,17 @@
/* eslint-disable @next/next/no-sync-scripts */
/*
eslint-disable @next/next/no-sync-scripts
⛔ 请勿删除:
我们在此处强制同步加载 /env.js 用于注入 window.RUNTIME_ENV,
以确保运行时 Supabase 等动态配置在 React 启动前就可用。
*/
import { Html, Head, Main, NextScript } from "next/document"
export default function Document() {
return (
<Html lang="en">
<Head>
<script src="/env.js" />
<script src="/env.js" async />
</Head>
<body>
<Main />

View File

@ -1,4 +1,3 @@
window.RUNTIME_ENV = {
SUPABASE_URL: "${SUPABASE_URL}",
OLLAMA_URL: "${OLLAMA_URL}"
SUPABASE_URL: "${SUPABASE_URL}"
};