From a6c78c0fa51f040a91b14b3a6f084744675c9bca Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Fri, 12 Dec 2025 12:44:10 +0800 Subject: [PATCH] update pay ui --- app.py | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 88 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 796d7fbf..b2f93fde 100755 --- a/app.py +++ b/app.py @@ -4190,8 +4190,50 @@ def wechat_callback(): update_wechat_session(state, {'status': new_status, 'user_info': {'user_id': user.id}}) print(f"✅ 微信扫码状态已更新: {new_status}, user_id: {user.id}") - # PC 模式直接跳转到首页 - return redirect('/home') + # ⚡ PC 扫码模式:返回简单页面,不重定向(避免 iframe 导航整个页面) + # 前端会通过轮询检测到状态变化,自动关闭弹窗 + return ''' + + + + + 授权成功 + + + +
+ + + + +

授权成功

+
+ + + ''', 200 except Exception as e: print(f"❌ 微信登录失败: {e}") @@ -4203,7 +4245,50 @@ def wechat_callback(): if wechat_session_exists(state): update_wechat_session(state, {'status': 'auth_failed', 'error': str(e)}) - return redirect('/home?error=login_failed') + # ⚡ 返回错误页面,不重定向 + return ''' + + + + + 授权失败 + + + +
+ + + + + +

授权失败,请重试

+
+ + + ''', 200 @app.route('/api/auth/login/wechat', methods=['POST'])