Browse Source

周视APP不会新增报名为loocam的推送信息,loocam APP亦然

peng 2 years ago
parent
commit
875bfa4cb8
1 changed files with 11 additions and 14 deletions
  1. 11 14
      Controller/UserController.py

+ 11 - 14
Controller/UserController.py

@@ -2143,15 +2143,14 @@ class v3LoginView(TemplateView):
         lang = request_dict.get('lang', 'en')
         lang = request_dict.get('lang', 'en')
         tz = request_dict.get('tz', None)
         tz = request_dict.get('tz', None)
         if all([app_bundle_id, app_type, push_type, token_val, m_code, tz]):
         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)
             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)
         now_time = datetime.datetime.utcnow().replace(tzinfo=utc).astimezone(utc)
         region_country = users['region_country']
         region_country = users['region_country']
         # 语言不存在返回英文
         # 语言不存在返回英文
@@ -2331,8 +2330,10 @@ 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_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:
             if appBundleId:
                 user_ex_qs = UserExModel.objects.filter(userID_id=userID)
                 user_ex_qs = UserExModel.objects.filter(userID_id=userID)
                 user_ex = None
                 user_ex = None
@@ -2422,10 +2423,6 @@ class InitInfoView(View):
                         UidPushModel.objects.create(userID_id=user_id, appBundleId=app_bundle_id, app_type=app_type,
                         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,
                                                     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'])
                                                     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:
         except Exception as e:
             LOGGER.info('出错了~保存推送配置信息错误,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
             LOGGER.info('出错了~保存推送配置信息错误,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))