diff --git a/0e10fd7fa68c9dda45b221f98145dd7a.jpg b/0e10fd7fa68c9dda45b221f98145dd7a.jpg new file mode 100644 index 0000000..806784b Binary files /dev/null and b/0e10fd7fa68c9dda45b221f98145dd7a.jpg differ diff --git a/src/app/api/user/route.ts b/src/app/api/user/route.ts index 4d1d365..0f13465 100644 --- a/src/app/api/user/route.ts +++ b/src/app/api/user/route.ts @@ -27,6 +27,8 @@ export async function GET(request: NextRequest) { maxAmount: env.MAX_RECHARGE_AMOUNT, maxDailyAmount: env.MAX_DAILY_RECHARGE_AMOUNT, methodLimits, + helpImageUrl: env.PAY_HELP_IMAGE_URL ?? null, + helpText: env.PAY_HELP_TEXT ?? null, }, }); } catch (error) { diff --git a/src/app/pay/page.tsx b/src/app/pay/page.tsx index db6bfd1..e749318 100644 --- a/src/app/pay/page.tsx +++ b/src/app/pay/page.tsx @@ -27,6 +27,8 @@ interface AppConfig { maxAmount: number; maxDailyAmount: number; methodLimits?: Record; + helpImageUrl?: string | null; + helpText?: string | null; } function PayContent() { @@ -64,8 +66,8 @@ function PayContent() { const effectiveUserId = resolvedUserId || userId; const isEmbedded = uiMode === 'embedded' && isIframeContext; const hasToken = token.length > 0; - const helpImageUrl = (process.env.NEXT_PUBLIC_PAY_HELP_IMAGE_URL || '').trim(); - const helpText = (process.env.NEXT_PUBLIC_PAY_HELP_TEXT || '').trim(); + const helpImageUrl = (config.helpImageUrl || '').trim(); + const helpText = (config.helpText || '').trim(); const hasHelpContent = Boolean(helpImageUrl || helpText); useEffect(() => { @@ -100,6 +102,8 @@ function PayContent() { maxAmount: cfgData.config.maxAmount ?? 1000, maxDailyAmount: cfgData.config.maxDailyAmount ?? 0, methodLimits: cfgData.config.methodLimits, + helpImageUrl: cfgData.config.helpImageUrl ?? null, + helpText: cfgData.config.helpText ?? null, }); } } else if (cfgRes.status === 404) { diff --git a/src/lib/config.ts b/src/lib/config.ts index 6a0a8df..f54446b 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -56,8 +56,8 @@ const envSchema = z.object({ ADMIN_TOKEN: z.string().min(1), NEXT_PUBLIC_APP_URL: z.string().url(), - NEXT_PUBLIC_PAY_HELP_IMAGE_URL: optionalTrimmedString, - NEXT_PUBLIC_PAY_HELP_TEXT: optionalTrimmedString, + PAY_HELP_IMAGE_URL: optionalTrimmedString, + PAY_HELP_TEXT: optionalTrimmedString, }); export type Env = z.infer;