本帖最后由 15820394839 于 2022-4-29 16:37 编辑
企业微信接收消息API验证URL的请求不通过,用调试工具是有返回值的,大佬帮忙看看?
[Python] 纯文本查看 复制代码 @app.route('/wx/receive_task', methods=
from flask import Flask,request
import sys
import urllib.parse
sys.path.append("./api/callback")
from WXBizMsgCrypt3 import *
app=Flask(__name__)
#@app.route("/test/")
#def test():
# return "hello world"
@app.route('/wx/receive_task', methods=['POST','GET'])def receive():
try:
msg_signature = request.args.get('msg_signature')
timestamp = request.args.get('timestamp')
nonce = request.args.get('nonce')
echostr = request.args.get('echostr')
echostr1 = urllib.parse.unquote(echostr)
auth_verify = WXBizMsgCrypt('w835iWzy','zagjYbTHM1LJh5aJUyGDAOJeou81a4s','ww3bb4de4c11111')
#sReplyEchoStr = auth_verify.DecryptMsg(echostr,msg_signature,timestamp,nonce)
s_echo_str = auth_verify.VerifyURL(msg_signature,timestamp,nonce,echostr1)
return str(s_echo_str)
except Exception as e:
print(e)
if __name__=='__main__':
app.run(host='10.0.4.18',port=8082) |