| | |
| | | from lib import mylog, CommFunc
|
| | | import os.path
|
| | | import zipfile
|
| | | import time
|
| | |
|
| | | # get: request.query.username request.GET.get('username','')
|
| | | # post: request.forms.get('username') request.POST.get('username')
|
| | |
| | |
|
| | | wxdata['status'] = 1
|
| | | wxdata['accid'] = dataDict.get("accid", "") # 此处用原始账号
|
| | | wxdata['usetime'] = str(datetime.datetime.today())
|
| | | wxdata['usetime'] = str(datetime.datetime.today()).split(".")[0]
|
| | |
|
| | | wxdata['appid'] = agentName
|
| | | wxdata['serverid'] = 's%s'%sid
|
| | |
| | | post['ip'] = wxdata['ip']
|
| | | post['level'] = wxdata['level']
|
| | | post['viplevel'] = wxdata['viplevel']
|
| | | post['time'] = wxdata['usetime'] |
| | | post['time'] = int(time.time())
|
| | |
|
| | | key = ConfigIO.GetValue("Coupon", "%s_wxkey"%operateID)
|
| | | key = ConfigIO.GetValue("Coupon", "key_%s"%post['appid'])
|
| | | #md5(appid=$appid®ionid=$regionid&passport=$passport&&money=$money&time=$time$app_secret)
|
| | | sign = md5.md5("appid=%s®ionid=%s&passport=%s&money=%s&time=%s%s"%(\
|
| | | post['appid'], post['regionid'], post['passport'], post['money'], post['time'], key)).hexdigest()
|
| | | |
| | | post['Sign'] = sign
|
| | | result = urllib2.urlopen(billurl, urllib.urlencode(post), 3)
|
| | | mylog.debug("SendDataCollectorBillInfo result %s"%result.read())
|
| | | signStr = "appid=%s®ionid=%s&passport=%s&money=%s&time=%s%s"%(\
|
| | | post['appid'], post['regionid'], post['passport'], post['money'], post['time'], key)
|
| | | sign = md5.md5(signStr).hexdigest()
|
| | | #mylog.debug("SendDataCollectorBillInfo %s-%s-%s-%s"%(signStr, sign, key, post))
|
| | | post['sign'] = sign
|
| | | result = urllib2.urlopen(billurl +"?" + urllib.urlencode(post), timeout =3)
|
| | | #mylog.debug("SendDataCollectorBillInfo result %s"%result.read())
|
| | |
|
| | | except Exception, e:
|
| | | mylog.debug("SendDataCollectorBillInfo error %s"%e)
|