bugfix
This commit is contained in:
parent
6191665fb4
commit
db396f2447
@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
from traceback import format_exc
|
||||
import os
|
||||
import time
|
||||
import base64
|
||||
@ -220,10 +221,11 @@ class WOAHandler:
|
||||
|
||||
# 4. 解析 XML 为字典
|
||||
msg_dict = self._parse_xml(xml_str)
|
||||
debug(f"收到消息: {msg_dict.get('MsgType')} from {msg_dict.get('FromUserName')}")
|
||||
debug(f"收到消息: {msg_dict}")
|
||||
|
||||
# --- 业务逻辑 ---
|
||||
reply_dic = await self.msghandle(msg_dict)
|
||||
debug(f'返回的消息:{reply_dic}')
|
||||
reply_xml = await self.build_reply(msg_dict, reply_dic)
|
||||
debug(f'收到微信消息:{msg_dict} 返回:{reply_xml}')
|
||||
|
||||
@ -246,7 +248,7 @@ class WOAHandler:
|
||||
return web.Response(text="success")
|
||||
|
||||
except Exception as e:
|
||||
exception(f"处理消息异常: {e}")
|
||||
debug(f"处理消息异常: {e}:{format_exc()}")
|
||||
return web.Response(text="success")
|
||||
|
||||
def _parse_xml(self, xml_str: str) -> Dict[str, Any]:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user