This commit is contained in:
pengyuthon
2026-03-09 17:03:35 +08:00
parent 0eb205dfee
commit 17bc43c736
+6 -3
View File
@@ -301,12 +301,15 @@ class Home(http.Controller):
headers=[('Content-Type', 'application/json')] headers=[('Content-Type', 'application/json')]
) )
@http.route('/phone/wechat/callback', type='http', auth="none", csrf=False, cors='*', methods=['GET']) @http.route([
def phone_wechat_callback(self, code=None, state=None, **kw): '/phone/wechat/callback',
'/phone/wechat/callback/<string:v_route>'
], type='http', auth="none", csrf=False, cors='*', methods=['GET'])
def phone_wechat_callback(self, code=None, state=None, v_route='Workbench', **kw):
try: try:
frontend_base_url = 'https://phone.thtzjt.com' frontend_base_url = 'https://phone.thtzjt.com'
if code: 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: if state:
redirect_url += f"&state={state}" redirect_url += f"&state={state}"
_logger.info(f"手机端OAuth回调,重定向到: {redirect_url}") _logger.info(f"手机端OAuth回调,重定向到: {redirect_url}")