|
@@ -961,7 +961,9 @@ class v2authCodeView(TemplateView):
|
|
start_time = time.time()
|
|
start_time = time.time()
|
|
send_res = self.send_email(send_data, email, identifyingCode) # 发送验证码到用户邮箱
|
|
send_res = self.send_email(send_data, email, identifyingCode) # 发送验证码到用户邮箱
|
|
end_time = time.time()
|
|
end_time = time.time()
|
|
- LOGGER.info('{}阿里云邮箱发送验证码执行时间: {:.3f} 秒,email:{}'.format(CONFIG_INFO, (end_time - start_time), email))
|
|
|
|
|
|
+ LOGGER.info(
|
|
|
|
+ '{}阿里云邮箱发送验证码执行时间: {:.3f} 秒,email:{}'.format(CONFIG_INFO, (end_time - start_time),
|
|
|
|
+ email))
|
|
if send_res is not True:
|
|
if send_res is not True:
|
|
return response.json(44)
|
|
return response.json(44)
|
|
# 单个邮箱验证码有效期5分钟
|
|
# 单个邮箱验证码有效期5分钟
|
|
@@ -2566,7 +2568,7 @@ class InitInfoView(View):
|
|
if m_code[:4] == 'iOS_':
|
|
if m_code[:4] == 'iOS_':
|
|
m_code = m_code[4:]
|
|
m_code = m_code[4:]
|
|
if all([token_val, push_type, appBundleId, userID]):
|
|
if all([token_val, push_type, appBundleId, userID]):
|
|
- self.save_push_config(userID, appBundleId, push_type, token_val, m_code, lang, tz)
|
|
|
|
|
|
+ self.save_push_config(userID, appBundleId, push_type, token_val, m_code, lang, tz, jg_token_val)
|
|
self.save_or_creat_uid_push(userID, appBundleId, push_type, token_val, m_code, lang, tz, now_time,
|
|
self.save_or_creat_uid_push(userID, appBundleId, push_type, token_val, m_code, lang, tz, now_time,
|
|
jg_token_val)
|
|
jg_token_val)
|
|
if appBundleId:
|
|
if appBundleId:
|
|
@@ -2624,13 +2626,14 @@ class InitInfoView(View):
|
|
return False
|
|
return False
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
- def save_push_config(user_id, app_bundle_id, push_type, token_val, m_code, lang, tz):
|
|
|
|
|
|
+ def save_push_config(user_id, app_bundle_id, push_type, token_val, m_code, lang, tz, jg_token_val):
|
|
"""
|
|
"""
|
|
异步保存新推送配置
|
|
异步保存新推送配置
|
|
@param user_id: 用户id
|
|
@param user_id: 用户id
|
|
@param app_bundle_id: app版本包id
|
|
@param app_bundle_id: app版本包id
|
|
@param push_type: 推送类型 0:Ios,1:Google,2:国内极光
|
|
@param push_type: 推送类型 0:Ios,1:Google,2:国内极光
|
|
@param token_val: 推送token
|
|
@param token_val: 推送token
|
|
|
|
+ @param token_val: 极光推送token
|
|
@param m_code: 手机唯一标识
|
|
@param m_code: 手机唯一标识
|
|
@param lang: 语言
|
|
@param lang: 语言
|
|
@param tz: 时区
|
|
@param tz: 时区
|
|
@@ -2641,10 +2644,12 @@ class InitInfoView(View):
|
|
gateway_push_qs = GatewayPush.objects.filter(user_id=user_id, m_code=m_code)
|
|
gateway_push_qs = GatewayPush.objects.filter(user_id=user_id, m_code=m_code)
|
|
if gateway_push_qs.exists():
|
|
if gateway_push_qs.exists():
|
|
if gateway_push_qs.first().token_val != token_val:
|
|
if gateway_push_qs.first().token_val != token_val:
|
|
- gateway_push_qs.update(token_val=token_val, push_type=push_type, logout=False)
|
|
|
|
|
|
+ gateway_push_qs.update(token_val=token_val, push_type=push_type, logout=False,
|
|
|
|
+ jg_token_val=jg_token_val)
|
|
else:
|
|
else:
|
|
GatewayPush.objects.create(user_id=user_id, app_bundle_id=app_bundle_id, app_type=app_type,
|
|
GatewayPush.objects.create(user_id=user_id, app_bundle_id=app_bundle_id, app_type=app_type,
|
|
- push_type=push_type, token_val=token_val, m_code=m_code, lang=lang, tz=tz)
|
|
|
|
|
|
+ push_type=push_type, token_val=token_val, m_code=m_code, lang=lang, tz=tz,
|
|
|
|
+ jg_token_val=jg_token_val)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
print('出错了~异步保存配置信息错误,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
print('出错了~异步保存配置信息错误,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
@@ -2855,7 +2860,8 @@ class wxAuthSignView(TemplateView):
|
|
# 如果用户为绑定过则创建用户并进行登录返回token
|
|
# 如果用户为绑定过则创建用户并进行登录返回token
|
|
userID = CommonService.getUserID(getUser=False)
|
|
userID = CommonService.getUserID(getUser=False)
|
|
nickname = res_json['nickname'] + '_' + CommonService.RandomStr(4)
|
|
nickname = res_json['nickname'] + '_' + CommonService.RandomStr(4)
|
|
- return self.do_register(userID, nickname, response, appBundleID, token_val, token_version, unionID)
|
|
|
|
|
|
+ return self.do_register(userID, nickname, response, appBundleID, token_val, token_version,
|
|
|
|
+ unionID)
|
|
else:
|
|
else:
|
|
return response.json(414, 'access_token,openid')
|
|
return response.json(414, 'access_token,openid')
|
|
else:
|
|
else:
|
|
@@ -4638,7 +4644,8 @@ class AppleAuthLogin(View):
|
|
nickname = claims['email']
|
|
nickname = claims['email']
|
|
else:
|
|
else:
|
|
nickname = 'apple_{num}'.format(num=CommonService.RandomStr(6, False))
|
|
nickname = 'apple_{num}'.format(num=CommonService.RandomStr(6, False))
|
|
- return self.do_register(userID, nickname, response, app_bundle_id, token_val, token_version, unionID)
|
|
|
|
|
|
+ return self.do_register(userID, nickname, response, app_bundle_id, token_val, token_version,
|
|
|
|
+ unionID)
|
|
|
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
print(e)
|
|
print(e)
|