| | |
| | | }
|
| | |
|
| | | # 发放奖励邮件内容json,utf8编码
|
| | | f = open(os.getcwd() + "\\..\\Coupon\\CodeMail.json", "r")
|
| | | g_mailJsonDict = {} # {channel:MailJson, ...}
|
| | | # 发放奖励邮件内容json,utf8编码
|
| | | def GetMailJson(channel):
|
| | | global g_mailJsonDict
|
| | | if channel in g_mailJsonDict:
|
| | | return g_mailJsonDict[channel]
|
| | | jsonPath = os.getcwd() + ("\\..\\Coupon\\CodeMail_%s.json" % channel)
|
| | | if not os.path.isfile(jsonPath):
|
| | | jsonPath = os.getcwd() + "\\..\\Coupon\\CodeMail.json"
|
| | | f = open(jsonPath, "r")
|
| | | MailJson = eval(f.read())
|
| | | f.close()
|
| | | g_mailJsonDict[channel] = MailJson
|
| | | return MailJson
|
| | |
|
| | | myapp = Bottle()
|
| | |
|
| | |
| | | return json.dumps({"error":"param couponType"}, ensure_ascii=False)
|
| | |
|
| | | prefix = "" # 固定前缀
|
| | | MailJson = GetMailJson(appid)
|
| | | if couponType in MailJson:
|
| | | mailInfo = MailJson[couponType]
|
| | | prefix = mailInfo.get("Prefix", "")
|