From 17bc43c736fae305cadce4cdbaf940e374174ed4 Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Mon, 9 Mar 2026 17:03:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_wechat/controllers/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/yuthon_wechat/controllers/main.py b/yuthon_wechat/controllers/main.py index 37fe52d87..7a7f4541a 100644 --- a/yuthon_wechat/controllers/main.py +++ b/yuthon_wechat/controllers/main.py @@ -301,12 +301,15 @@ class Home(http.Controller): headers=[('Content-Type', 'application/json')] ) - @http.route('/phone/wechat/callback', type='http', auth="none", csrf=False, cors='*', methods=['GET']) - def phone_wechat_callback(self, code=None, state=None, **kw): + @http.route([ + '/phone/wechat/callback', + '/phone/wechat/callback/' + ], type='http', auth="none", csrf=False, cors='*', methods=['GET']) + def phone_wechat_callback(self, code=None, state=None, v_route='Workbench', **kw): try: frontend_base_url = 'https://phone.thtzjt.com' if code: - redirect_url = f"{frontend_base_url}/phone/WechatCallback?code={code}" + redirect_url = f"{frontend_base_url}/phone/WechatCallback?code={code}?v_route={v_route}" if state: redirect_url += f"&state={state}" _logger.info(f"手机端OAuth回调,重定向到: {redirect_url}")