pengzhibo168 5 سال پیش
والد
کامیت
d2c13e58e2
1فایلهای تغییر یافته به همراه6 افزوده شده و 4 حذف شده
  1. 6 4
      Controller/DetectController.py

+ 6 - 4
Controller/DetectController.py

@@ -131,11 +131,10 @@ class NotificationView(View):
                         redisObj.set_data(key=dkey, val=1, expire=detect_interval)
                 redisObj.set_data(key=pkey, val=1, expire=60)
 
-        # 打印have_ykey
-        return JsonResponse(status=200, data={'pkey': 0, 'have_ykey': have_ykey, 'have_pkey': have_pkey,
-                                                  'have_ykey': have_dkey})
+            # 打印have_ykey
+        # return JsonResponse(status=200, data={'pkey': 0, 'have_ykey': have_ykey, 'have_pkey': have_pkey, 'have_ykey': have_dkey})
 
-    # 旧模式并且没有pkey,重新创建一个
+        # 旧模式并且没有pkey,重新创建一个
         if not detect_group and not have_pkey:
             # 设置推送时间为60秒一次
             redisObj.set_data(key=pkey, val=1, expire=60)
@@ -353,6 +352,9 @@ class NotificationView(View):
             n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
             res = cli.push(n=n, device_token=token_val, topic=appBundleId)
             print(res.status_code)
+
+            return JsonResponse(status=200, data={'pkey00000000000000000': 0, 'res':res})
+
             if res.status_code == 200:
                 print('apns push success')
                 return