|
@@ -561,6 +561,7 @@ class v2authCodeView(TemplateView):
|
|
|
email = request_dict.get('email', None)
|
|
|
phone = request_dict.get('phone', None)
|
|
|
country_code = request_dict.get('country_code', None)
|
|
|
+ sign_name = request_dict.get('sign_name', None)
|
|
|
if email is not None:
|
|
|
email = email.strip()
|
|
|
# 阿里云的发送邮箱的调用方法
|
|
@@ -570,10 +571,10 @@ class v2authCodeView(TemplateView):
|
|
|
elif phone is not None:
|
|
|
phone = phone.strip()
|
|
|
if country_code is None:
|
|
|
- return self.phoneCode(phone, response)
|
|
|
+ return self.phoneCode(phone, response, sign_name)
|
|
|
else:
|
|
|
country_code = str(country_code.strip())
|
|
|
- return self.phoneCodeV2(country_code, phone, response)
|
|
|
+ return self.phoneCodeV2(country_code, phone, response, sign_name)
|
|
|
else:
|
|
|
return response.json(444)
|
|
|
|
|
@@ -650,7 +651,7 @@ class v2authCodeView(TemplateView):
|
|
|
return response.json(10, 'error')
|
|
|
return response.json(0)
|
|
|
|
|
|
- def phoneCode(self, phone, response):
|
|
|
+ def phoneCode(self, phone, response, sign_name):
|
|
|
dataValid = DataValid()
|
|
|
if dataValid.mobile_validate(phone) is not True:
|
|
|
return response.json(107)
|
|
@@ -668,7 +669,11 @@ class v2authCodeView(TemplateView):
|
|
|
identifyingCode = RandomStr(6, True)
|
|
|
# 发送手机验证码
|
|
|
aliSms = AliSmsObject()
|
|
|
- res = aliSms.send_code_sms(phone=phone, code=identifyingCode, sign_name='Ansjer',
|
|
|
+ if sign_name == 'zosi':
|
|
|
+ sign_ms = '周视'
|
|
|
+ else:
|
|
|
+ sign_ms = 'Ansjer'
|
|
|
+ res = aliSms.send_code_sms(phone=phone, code=identifyingCode, sign_name=sign_ms,
|
|
|
temp_msg='SMS_151600991')
|
|
|
print(res)
|
|
|
if res["Code"] == "OK":
|
|
@@ -680,7 +685,7 @@ class v2authCodeView(TemplateView):
|
|
|
else:
|
|
|
return response.json(10, res["Message"])
|
|
|
|
|
|
- def phoneCodeV2(self, country_code, phone, response):
|
|
|
+ def phoneCodeV2(self, country_code, phone, response, sign_name):
|
|
|
dataValid = DataValid()
|
|
|
if dataValid.mobile_validate(phone) is not True:
|
|
|
return response.json(107)
|
|
@@ -696,18 +701,29 @@ class v2authCodeView(TemplateView):
|
|
|
if user_qs.exists() or phone_qs.exists():
|
|
|
return response.json(101)
|
|
|
identifyingCode = RandomStr(6, True)
|
|
|
+ # 短信签名
|
|
|
+ # sign_name_dict = {
|
|
|
+ # 'ansjer':'Ansjer',
|
|
|
+ # 'zosi':'周视'
|
|
|
+ # }
|
|
|
+ sign_ms = ''
|
|
|
if country_code == '86':
|
|
|
# 国内短信推送模板
|
|
|
temp_msg = 'SMS_151600991'
|
|
|
rec_phone = phone
|
|
|
+ if sign_name == 'zosi':
|
|
|
+ sign_ms = '周视'
|
|
|
+ else:
|
|
|
+ sign_ms = 'Ansjer'
|
|
|
else:
|
|
|
# 国际短信推送模板
|
|
|
temp_msg = 'SMS_172165867'
|
|
|
rec_phone = country_code + phone
|
|
|
- # if ph
|
|
|
+ sign_ms = 'Ansjer'
|
|
|
+
|
|
|
# 发送手机验证码
|
|
|
aliSms = AliSmsObject()
|
|
|
- res = aliSms.send_code_sms(phone=rec_phone, code=identifyingCode, sign_name='Ansjer',
|
|
|
+ res = aliSms.send_code_sms(phone=rec_phone, code=identifyingCode, sign_name=sign_ms,
|
|
|
temp_msg=temp_msg)
|
|
|
print(res)
|
|
|
if res["Code"] == "OK":
|