代码:
@app.get("/wx")
def auto_reply(signature:str, timestamp:str, nonce:str, echostr:str):
token = "***"
my_signature = SHA1().getSHA1(token, timestamp, nonce)
print(my_signature, signature)
if my_signature==signature:
print("success")
return echostr
else:
return None
验证成功并成功返回:
请求时间: 81.69.103.147 - - [20/Apr/2022:18:13:39 +0800]
麻烦看一下这是怎么回事,谢谢!
改为 return int(echostr) 即可