From 016c0f353469dffb3014cac735dec81864e1c87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=B7=E5=B0=8F=E5=89=8D?= Date: Fri, 23 Jan 2026 17:17:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0ios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 31acce26..f326ae46 100755 --- a/app.py +++ b/app.py @@ -3786,10 +3786,14 @@ def wechat_h5_payment_callback(): return redirect(redirect_url) except Exception as e: - print(f"[微信H5支付] 回调处理失败: {e}") import traceback - traceback.print_exc() - return redirect(f'https://valuefrontier.cn/home/pages/account/subscription?wechat_pay_error=callback_failed') + error_detail = traceback.format_exc() + print(f"[微信H5支付] 回调处理失败: {e}") + print(f"[微信H5支付] 详细错误: {error_detail}") + # 临时:将错误信息编码后传递给前端,方便调试 + import urllib.parse + error_msg = urllib.parse.quote(str(e)[:100]) + return redirect(f'https://valuefrontier.cn/home/pages/account/subscription?wechat_pay_error=callback_failed&detail={error_msg}') @app.route('/api/payment/wechat/jsapi/create-order', methods=['POST'])