peng 1 gadu atpakaļ
vecāks
revīzija
75fe01b9f9
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      Service/PushService.py

+ 2 - 2
Service/PushService.py

@@ -517,7 +517,7 @@ class PushObject:
             # 发送推送
             push_url = 'https://push-api.cloud.hihonor.com/api/v1/{}/sendMessage'.format(app_id)
             headers = {'Content-Type': 'application/json', 'Authorization': authorization_token,
-                       'timestamp': str(n_time * 1000)}
+                       'timestamp': str(int(n_time) * 1000)}
             extra_data = {'alert': 'Motion', 'msg': '', 'sound': 'sound.aif', 'zpush': '1',
                           'received_at': n_time, 'event_time': n_time, 'event_type': event_type, 'nickname': nickname,
                           'uid': uid, 'channel': channel
@@ -540,7 +540,7 @@ class PushObject:
             LOGGER.info("荣耀推送返回值:{}".format(response.json()))
             return True
         except Exception as e:
-            LOGGER.info("荣耀推送异常:{}".format(repr(e)))
+            LOGGER.info("荣耀推送异常:error_line:{},error_msg:{}".format(e.__traceback__.tb_lineno, repr(e)))
             return False
 
     @staticmethod