From b9a2bd5befd8e6eb1fc53d96050214f9f8917f5c Mon Sep 17 00:00:00 2001 From: wwwwwwwww <526125649@qq.com> Date: Fri, 12 Jun 2026 10:35:14 +0800 Subject: [PATCH] 1 --- .../src/components/Layout/AppLayout.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/video-gen-app/src/components/Layout/AppLayout.tsx b/video-gen-app/src/components/Layout/AppLayout.tsx index c19e1424..fffe327f 100644 --- a/video-gen-app/src/components/Layout/AppLayout.tsx +++ b/video-gen-app/src/components/Layout/AppLayout.tsx @@ -693,13 +693,15 @@ const AppLayout: React.FC = () => { try { setPaying(true); const order = await createRechargeOrder(plan.id, paymentMethod); - if (order.paymentMethod === 'alipay' && order.qrUrl) { - // Alipay: show the real QR code URL from the backend + // 检查是否有二维码信息,支持支付宝和微信支付 + const qrCode = order.qrUrl || order.codeUrl || order.qr_code || order.code_url; + if ((order.paymentMethod === 'alipay' || order.paymentMethod === 'wechat') && qrCode) { + // Alipay or WeChat Pay: show the QR code const paymentInfo = { price: plan.price, credits: totalCredits, - qrCode: order.qrUrl, - method: 'alipay', + qrCode: qrCode, + method: order.paymentMethod, }; setCurrentPaymentInfo(paymentInfo); setRechargeModalOpen(false); @@ -711,8 +713,8 @@ const AppLayout: React.FC = () => { orderNo: order.orderNo, price: plan.price, credits: totalCredits, - qrCode: order.qrUrl, - method: 'alipay', + qrCode: qrCode, + method: order.paymentMethod, createdAt: order.createdAt || new Date().toISOString(), timeoutSeconds: 180, })); @@ -720,7 +722,7 @@ const AppLayout: React.FC = () => { // Start polling for payment status startPolling(order.orderNo); } else { - // WeChat or mock mode (mock auto-completes, no QR needed) + // Mock mode (auto-completes, no QR needed) message.success('充值成功!积分已到账'); useAuthStore.getState().refreshUser(); setRechargeModalOpen(false);