|
@@ -2142,15 +2142,14 @@ class v3LoginView(TemplateView):
|
|
|
lang = request_dict.get('lang', 'en')
|
|
|
tz = request_dict.get('tz', None)
|
|
|
if all([app_bundle_id, app_type, push_type, token_val, m_code, tz]):
|
|
|
- gateway_push_qs = GatewayPush.objects.filter(user_id=userID, m_code=m_code)
|
|
|
- if gateway_push_qs.exists():
|
|
|
- gateway_push_qs.update(token_val=token_val, push_type=push_type, logout=False)
|
|
|
- else:
|
|
|
- GatewayPush.objects.create(user_id=userID, 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)
|
|
|
+ if 'loocam' in app_bundle_id:
|
|
|
+ gateway_push_qs = GatewayPush.objects.filter(user_id=userID, m_code=m_code)
|
|
|
+ if gateway_push_qs.exists():
|
|
|
+ gateway_push_qs.update(token_val=token_val, push_type=push_type, logout=False)
|
|
|
+ else:
|
|
|
+ GatewayPush.objects.create(user_id=userID, 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)
|
|
|
UidPushModel.objects.filter(userID=userID, m_code=m_code).update(token_val=token_val, push_type=push_type)
|
|
|
- if app_bundle_id == 0 or app_bundle_id == '0':
|
|
|
- LOGGER.info('v3/account/login接口推送数据:{}'.format(request_dict))
|
|
|
now_time = datetime.datetime.utcnow().replace(tzinfo=utc).astimezone(utc)
|
|
|
region_country = users['region_country']
|
|
|
# 语言不存在返回英文
|
|
@@ -2330,8 +2329,10 @@ class InitInfoView(View):
|
|
|
if m_code[:4] == 'iOS_':
|
|
|
m_code = m_code[4:]
|
|
|
if all([token_val, push_type, appBundleId, userID]):
|
|
|
- self.save_push_config(userID, appBundleId, push_type, token_val, m_code, lang, tz)
|
|
|
- self.save_or_creat_uid_push(userID, appBundleId, push_type, token_val, m_code, lang, tz, now_time)
|
|
|
+ if 'loocam' in appBundleId:
|
|
|
+ self.save_push_config(userID, appBundleId, push_type, token_val, m_code, lang, tz)
|
|
|
+ if 'loocam' not in appBundleId:
|
|
|
+ self.save_or_creat_uid_push(userID, appBundleId, push_type, token_val, m_code, lang, tz, now_time)
|
|
|
if appBundleId:
|
|
|
user_ex_qs = UserExModel.objects.filter(userID_id=userID)
|
|
|
user_ex = None
|
|
@@ -2421,10 +2422,6 @@ class InitInfoView(View):
|
|
|
UidPushModel.objects.create(userID_id=user_id, appBundleId=app_bundle_id, app_type=app_type,
|
|
|
push_type=push_type, token_val=token_val, m_code=m_code, lang=lang,
|
|
|
tz=tz, addTime=now_time, updTime=now_time, uid_set_id=item['id'])
|
|
|
- if app_bundle_id == 0 or app_bundle_id == '0':
|
|
|
- LOGGER.info(
|
|
|
- 'user/initInfo接口推送数据:appBundleId:{},app_type:{},push_type:{},token_val:{},m_code:{}'.format(
|
|
|
- app_bundle_id, app_type, push_type, token_val, m_code))
|
|
|
except Exception as e:
|
|
|
LOGGER.info('出错了~保存推送配置信息错误,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|