This commit is contained in:
yumoqing 2026-03-03 11:48:05 +08:00
parent bf59d7be15
commit db21abbaa6

View File

@ -246,13 +246,7 @@ class WOAHandler:
encrypted_xml_str = self._encrypt_msg(reply_xml, nonce, timestamp)
# 构造加密后的返回 XML 包
final_xml = f"""
<xml>
<Encrypt><![CDATA[{encrypted_xml_str}]]></Encrypt>
<MsgSignature><![CDATA[{hashlib.sha1((self.token + timestamp + nonce + encrypted_xml_str).encode()).hexdigest()}]]></MsgSignature>
<TimeStamp>{timestamp}</TimeStamp>
<Nonce><![CDATA[{nonce}]]></Nonce>
</xml>
"""
<xml><Encrypt><![CDATA[{encrypted_xml_str}]]></Encrypt><MsgSignature><![CDATA[{hashlib.sha1((self.token + timestamp + nonce + encrypted_xml_str).encode()).hexdigest()}]]></MsgSignature><TimeStamp>{timestamp}</TimeStamp><Nonce><![CDATA[{nonce}]]></Nonce></xml>"""
debug(f'加密后的返回:{final_xml}')
return web.Response(text=final_xml, content_type='application/xml')
elif reply_xml: