Переглянути джерело

Merge branch 'release' of http://192.168.136.45:3000/SERVER/AnsjerPush into release

chanjunkai 5 роки тому
батько
коміт
39c535a05a
1 змінених файлів з 4 додано та 2 видалено
  1. 4 2
      Controller/DetectController.py

+ 4 - 2
Controller/DetectController.py

@@ -62,14 +62,13 @@ class NotificationView(View):
         if etk:
             eto = ETkObject(etk)
             uid = eto.uid
-            # uid += channel
             if len(uid) != 20:
                 return JsonResponse(status=200, data={'code': 404, 'msg': 'data is not exist'})
         else:
             utko = UidTokenObject(uidToken)
             uid = utko.UID
         pkey = '{uid}_{channel}_ptl'.format(uid=uid, channel=channel)
-        ykey = '{uid}_redis_qs'.format(uid=uid)
+        ykey = '{uid}_{channel}_redis_qs'.format(uid=uid, channel=channel)
         dkey = '{uid}_{channel}_{event_type}_flag'.format(uid=uid, event_type=event_type, channel=channel)
         # 判断redisObj.get_data(key=pkey):不为空
         redisObj = RedisObject(db=6)
@@ -97,7 +96,9 @@ class NotificationView(View):
                 redis_list.append(qs)
             # 修改redis数据,并设置过期时间为10分钟
             redisObj.set_data(key=ykey, val=str(redis_list), expire=600)
+
         if not redis_list:
+            print("没有redi_list")
             res_data = {'code': 0, 'msg': 'success!'}
             return JsonResponse(status=200, data=res_data)
         is_sys_msg = self.is_sys_msg(int(event_type))
@@ -150,6 +151,7 @@ class NotificationView(View):
             kwag_args['token_val'] = token_val
             kwag_args['msg_title'] = msg_title
             kwag_args['msg_text'] = msg_text
+            #推送
             if detect_med_type == 2 or detect_med_type == 0:
                 if push_type == 0:  # ios apns
                     self.do_apns(**kwag_args)