This commit is contained in:
eric
2026-03-08 03:40:53 -05:00
parent f589b71b19
commit 51eeea3be3
8 changed files with 747 additions and 138 deletions

19
app/lib/env.ts Normal file
View File

@@ -0,0 +1,19 @@
/**
* 环境配置:区分本地调试与生产部署
* 生产https://api.hackrobot.cnpayjsapi
*/
const isDev = process.env.NODE_ENV === "development";
/** 支付 API 地址payjsapi */
export const PAYMENT_API_URL =
process.env.PAYMENT_API_URL ||
(isDev ? "http://127.0.0.1:8700" : "https://api.hackrobot.cn");
/** 站点根地址(用于 return_url 等回跳,生产需配置) */
export const SITE_URL =
process.env.NEXT_PUBLIC_SITE_URL ||
(isDev ? "http://localhost:3001" : "https://hackrobot.cn");
/** 是否为本地开发 */
export const IS_DEV = isDev;