From 2745963fbc8de142b196edbe3d31b3a327bd0836 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 2 Mar 2026 13:53:17 +0800 Subject: [PATCH] bugfix --- woa/init.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/woa/init.py b/woa/init.py index b04fe8b..274f96d 100644 --- a/woa/init.py +++ b/woa/init.py @@ -180,9 +180,9 @@ class WOAHandler: """处理用户消息和事件""" # 1. 验证签名 query = request.query - signature = query.get('signature', '') - timestamp = query.get('timestamp', '') - nonce = query.get('nonce', '') + signature = query.get('signature', '') + timestamp = query.get('timestamp', '') + nonce = query.get('nonce', '') is_valid, _ = self._verify_signature(request) if not is_valid: return web.Response(text="failed", status=403) @@ -194,9 +194,9 @@ class WOAHandler: # decrypt_message 会自动处理解密和 XML 解析,返回 wechatpy 的消息对象 # 如果未开启加密,它也会正常解析 XML msg = self.crypto.decrypt_message(body, - signature=signature, - timestamp=timestamp, - nonce=nonce) + signature=signature, + timestamp=timestamp, + nonce=nonce) except Exception as e: error(f"消息解密或解析失败: {e}, {body=}") return web.Response(text="success") # 防止微信重试