From ba5fab6bb8a2843f9c2cb7ed217fea7bd781fa94 Mon Sep 17 00:00:00 2001 From: H Vs Date: Wed, 5 Mar 2025 17:52:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/login_resources.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/login_resources.py b/resources/login_resources.py index 035d26c..3a70e4a 100644 --- a/resources/login_resources.py +++ b/resources/login_resources.py @@ -69,7 +69,15 @@ class GetLoginWxQRCodeResource(Resource): app_id=loginfo.get('appId','') qr_code = gewe_chat.wxchat.get_login_qr_code(token_id, app_id,region_id) - base64_string = qr_code.get('qrImgBase64',None) + + if not qr_code: + msg=f"获取二维码失败,qr_code: {qr_code}" + gewe_chat.wxchat.release_login_lock(token_id) + logger.info(msg) + response=jsonify({'code': 501, 'message': msg}) + response.status_code = 501 + return response + uuid = qr_code.get('uuid',None) if not uuid: msg=f"uuid获取二维码失败,uuid: {uuid}" @@ -80,8 +88,10 @@ class GetLoginWxQRCodeResource(Resource): return response + app_id = app_id or qr_code.get('appId') - + + base64_string = qr_code.get('qrImgBase64',None) gewe_chat.wxchat.qrCallback(uuid,base64_string) hash_key = f"__AI_OPS_WX__:LOGININFO:{tel}" thread = threading.Thread(target=waitting_login_result, args=(gewe_chat.wxchat,token_id, app_id,region_id, agent_token_id,hash_key, uuid,now))