|
@@ -5,7 +5,7 @@ import os,re,random
|
|
|
import json,time,datetime
|
|
|
import shutil
|
|
|
import tempfile
|
|
|
-import zipfile
|
|
|
+import zipfile,requests
|
|
|
from docxtpl import DocxTemplate,InlineImage
|
|
|
from docx.shared import Mm
|
|
|
from django.db import transaction
|
|
@@ -3874,10 +3874,35 @@ def get_user_signup_order(request):
|
|
|
pay_status = qdata.get("pay_status")
|
|
|
if not user_id:
|
|
|
user_id = qdata.get("user_id")
|
|
|
- match_id = ccc.get_cur_match().id
|
|
|
+ match_id = ccc.get_signup_match().id
|
|
|
|
|
|
qset = cm.SignupOrder.objects.filter(user_id=user_id,match_id=match_id,pay_status=pay_status,order_status=pay_status)
|
|
|
qdata = qset.values().first()
|
|
|
|
|
|
return qdata
|
|
|
|
|
|
+
|
|
|
+def check_msg_content(request):
|
|
|
+ """
|
|
|
+ """
|
|
|
+ qdata = request.json
|
|
|
+ APPID = "wxb299e10e65157301"
|
|
|
+ APPSECRET = "20e278a60d52ad63822a07e49931435c"
|
|
|
+ token_url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s" % (APPID,APPSECRET)
|
|
|
+ res = requests.get(token_url,verify=False)
|
|
|
+ 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
|
|
|
+
|
|
|
+ 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()
|
|
|
+ return {}
|