调整内容

This commit is contained in:
liuwei
2025-04-22 13:01:40 +08:00
parent 2f2741b394
commit 978593edd1
2 changed files with 7 additions and 0 deletions

View File

@@ -24,6 +24,12 @@ async def callback(request: Request):
# 获取原始JSON数据
json_data = await request.json()
logger.info(f"收到回调消息: {json_data}")
# 检查是否为测试消息
if 'testMsg' in json_data and json_data.get('testMsg') == '验证回调地址是否可用':
logger.info("收到回调地址验证消息,返回成功")
return {"code": 0, "message": "success"}
# 创建消息对象
msg = WxMessage.from_json(json_data)

View File

@@ -410,6 +410,7 @@ class Robot(Job):
contacts_dict = {}
# 获取所有联系人的wxid列表
contacts_wxids = self.client.fetch_contacts_list(self.app_id)
self.LOG.info(f"contacts_wxids: {contacts_wxids}")
if not contacts_wxids:
self.LOG.warning("获取联系人列表为空")
return contacts_dict