修改 .env.example,补充环境切换说明并新增生产环境 API 地址配置。 更新 next.config.ts:使用 API_BASE_URL 进行 API 重写配置,确保 API 路由一致性。 重构 login-form.tsx:移除 API 配置检查逻辑,简化登录流程。 调整 admin-http.ts:通过 Next.js 代理转发 API 请求,提升后端通信稳定性。
10 lines
400 B
Plaintext
10 lines
400 B
Plaintext
# =============================================================================
|
|
# 管理端本地配置示例:复制为 .env.local 后按需修改
|
|
# =============================================================================
|
|
# 手动切换环境:保留一个生效,另一个注释掉
|
|
|
|
# 测试
|
|
API_BASE_URL=http://127.0.0.1:8000
|
|
# 线上
|
|
# API_BASE_URL=https://api.your-production-domain.com
|