From a4df33e01a95b3aa3e4c5a7de90fa65353109738 Mon Sep 17 00:00:00 2001 From: H Vs Date: Sat, 22 Mar 2025 11:30:37 +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 --- app/endpoints/pipeline_endpoint.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/endpoints/pipeline_endpoint.py b/app/endpoints/pipeline_endpoint.py index 84cbd4d..b33a1dc 100644 --- a/app/endpoints/pipeline_endpoint.py +++ b/app/endpoints/pipeline_endpoint.py @@ -29,7 +29,7 @@ async def get_chatroominfo(request: Request, body: Dict[str, Any]): k, loginfo = await request.app.state.gewe_service.get_login_info_by_app_id_async(app_id) if not k: logger.warning('找不到登录信息,不处理') - return {"message": "收到微信回调消息"} + return {"message": f"收到微信回调消息: {type_name}"} token_id=loginfo.get('tokenId','') @@ -192,19 +192,19 @@ async def handle_mod_contacts_async(request: Request,token_id,msg,wxid): loop ) - contact_wxid = msg_data["UserName"]["string"] - nickname=msg_data["NickName"]["string"] + contact_wxid =msg_data.get("UserName",{}).get("string","") #msg_data["UserName"]["string"] + nickname= msg_data.get("NickName",{}).get("string","")#msg_data["NickName"]["string"] city=msg_data.get("City","") signature=msg_data.get("Signature","") province=msg_data.get("Province","") - bigHeadImgUrl=msg_data["SnsUserInfo"]["SnsBgimgId"] + bigHeadImgUrl=msg_data.get("SnsUserInfo",{}).get("SnsBgimgId","") #msg_data["SnsUserInfo"]["SnsBgimgId"] country=msg_data.get("Country","") sex=msg_data.get("Sex",None) - pyInitial=msg_data["PyInitial"]["string"] - quanPin=msg_data["QuanPin"]["string"] - remark=msg_data.get("Remark").get("string","") - remarkPyInitial=msg_data.get("RemarkPyInitial").get("string","") - remarkQuanPin=msg_data.get("RemarkQuanPin").get("string","") + pyInitial= msg_data.get("PyInitial",{}).get("string","")#msg_data["PyInitial"]["string"] + quanPin=msg_data.get("QuanPin",{}).get("string","") #msg_data["QuanPin"]["string"] + remark=msg_data.get("Remark",{}).get("string","") + remarkPyInitial=msg_data.get("RemarkPyInitial",{}).get("string","") + remarkQuanPin=msg_data.get("RemarkQuanPin",{}).get("string","") smallHeadImgUrl=msg_data.get("smallHeadImgUrl","") # data=gewe_chat.wxchat.get_brief_info(token_id,app_id,[contact_wxid])