|
@@ -3893,16 +3893,21 @@ def check_msg_content(request):
|
|
|
access_token = res.json().get("access_token")
|
|
|
#check msg content
|
|
|
check_url = "https://api.weixin.qq.com/wxa/msg_sec_check?access_token=%s" % access_token
|
|
|
+ print(access_token)
|
|
|
|
|
|
openid = qdata.get('openid')
|
|
|
if openid:
|
|
|
- params = {
|
|
|
- "content":qdata.get("content"),
|
|
|
- "version":2,
|
|
|
- "scene":2,
|
|
|
- "openid":openid
|
|
|
-
|
|
|
- }
|
|
|
- rest = requests.post(check_url,json=params)
|
|
|
- return rest.json()
|
|
|
+ #params = {
|
|
|
+ # "content":qdata.get("content"),
|
|
|
+ # "version":2,
|
|
|
+ # "scene":2,
|
|
|
+ # "openid":openid
|
|
|
+
|
|
|
+ # }
|
|
|
+ #rest = requests.post(check_url,data=json.dumps(params),verify=False)
|
|
|
+ cmdStr = u"""
|
|
|
+ curl -X POST -H "Content-Type:application/json" -d '{"content":"%s","version":2,"scene":2,"openid":"%s"}' %s
|
|
|
+ """ % (qdata.get("content"),openid,check_url)
|
|
|
+ rst = json.loads(os.popen(cmdStr).read())
|
|
|
+ return rst
|
|
|
return {}
|