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

+ 4 - 4
Controller/DetectController.py

@@ -80,9 +80,9 @@ class NotificationView(View):
         # 一分钟外,推送开启状态
         detect_med_type = 0  # 0推送旧机制 1存库不推送,2推送存库
         # 暂时注销
-        # if have_pkey:
-        #     res_data = {'code': 0, 'msg': 'success11111111111111!'}
-        #     return JsonResponse(status=200, data=res_data)
+        if have_pkey:
+            res_data = {'code': 0, 'msg': 'success11111111111111!'}
+            return JsonResponse(status=200, data=res_data)
 
         # 数据库读取数据
         if have_ykey:
@@ -353,7 +353,7 @@ class NotificationView(View):
             alert = apns2.PayloadAlert(body=msg_text, title=msg_title)
             payload = apns2.Payload(alert=alert, custom=push_data)
 
-            return uid, channel, appBundleId, token_val, event_type, n_time, msg_title,msg_text
+            return uid, channel, appBundleId, str(token_val), event_type, n_time, msg_title,msg_text
             n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
             res = cli.push(n=n, device_token=token_val, topic=appBundleId)
             print(res.status_code)