diff --git a/astro.config.mjs b/astro.config.mjs index 532540e..a131aee 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,5 +1,5 @@ // @ts-check -import { defineConfig, envField } from 'astro/config'; +import { defineConfig } from 'astro/config'; import { fileURLToPath } from 'node:url'; import tailwindcss from '@tailwindcss/vite'; @@ -41,17 +41,6 @@ export default defineConfig({ mode: 'standalone' }), - // 环境变量声明:统一命名规范 - // BASE_API —— 公开/运行期 API 基址(浏览器 + 按需渲染共用,空 = 同源 /api) - // BASE_API_SSG —— 构建期 SSG 内部端口基址(仅服务端,绝不进前端 bundle) - // SSG_TOKEN —— SSG 内部接口可选访问令牌(仅服务端) - // 注意:Astro 仅自动把 PUBLIC_ 前缀变量暴露给客户端,BASE_API 没有该前缀, - // 故必须在 schema 中声明为 access:'public',否则浏览器端 import.meta.env.BASE_API 为 undefined。 - env: { - schema: { - BASE_API: envField.string({ context: 'client', access: 'public', optional: true }), - BASE_API_SSG: envField.string({ context: 'server', access: 'secret', optional: true }), - SSG_TOKEN: envField.string({ context: 'server', access: 'secret', optional: true }), - }, - }, + // base 地址配置已迁到 src/lib/config(dev/prod 两份 TS,缺则抛异常)。 + // 仅「密钥」类仍走构建期 env(如 SSG_TOKEN),不在此声明,也不进客户端 bundle。 }); \ No newline at end of file diff --git a/src/components/AuthModal.astro b/src/components/AuthModal.astro index 0d01d51..3167653 100644 --- a/src/components/AuthModal.astro +++ b/src/components/AuthModal.astro @@ -66,7 +66,8 @@ const fullLoginLabel = t('go to full login')