This commit is contained in:
root
2026-06-07 19:18:24 +08:00
parent a1daa040ef
commit 32b900547a
16 changed files with 127 additions and 427 deletions

View File

@@ -5,8 +5,8 @@
*/
import { getThemeConfig } from "./site.config";
import { IS_DEVELOPMENT } from "../runtime-env";
import {
DEFAULT_PAYMENT_API_URL,
resolvePaymentApiUrl,
DEFAULT_POCKETBASE_URL,
DEFAULT_MINIO_HOST,
@@ -64,7 +64,6 @@ export interface ServicesConfig {
minio: MinioConfig;
}
const isDev = process.env.NODE_ENV === "development";
const PAYJSAPI_PORT = process.env.PAYJSAPI_PORT || "8007";
/** 站点标识,用于 VIP 按站点隔离。digital 专题站(ai.xx/android.xx)各自独立,如 digital_ai、digital_android */
@@ -75,7 +74,7 @@ export const VIP_MASTER_SITE_ID = "vip";
export function getApiUrlFromRequest(hostHeader: string | null): string | null {
if (!hostHeader) return null;
if (!isDev) return resolvePaymentApiUrl();
if (!IS_DEVELOPMENT) return resolvePaymentApiUrl();
const hostname = hostHeader.split(":")[0];
return `http://${hostname}:${PAYJSAPI_PORT}`;
}