tanghongbin 4 rokov pred
rodič
commit
fcf947eac1
2 zmenil súbory, kde vykonal 11 pridanie a 1 odobranie
  1. 1 0
      Controller/DetectController.py
  2. 10 1
      Service/CommonService.py

+ 1 - 0
Controller/DetectController.py

@@ -199,6 +199,7 @@ class NotificationView(View):
             # 发送标题
             msg_title = self.get_msg_title(appBundleId=appBundleId, nickname=nickname)
             # 发送内容
+            CommonService.app_log_log(uid=uid, tz=tz)
             msg_text = self.get_msg_text(channel=channel, n_time=n_time, lang=lang, tz=tz,
                                          event_type=event_type)
             kwag_args['appBundleId'] = appBundleId

+ 10 - 1
Service/CommonService.py

@@ -204,4 +204,13 @@ class CommonService:
         if lang == 'cn':
             return time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(int(n_time)))
         else:
-            return time.strftime('%m-%d-%Y %H:%M:%S', time.gmtime(int(n_time)))
+            return time.strftime('%m-%d-%Y %H:%M:%S', time.gmtime(int(n_time)))
+
+    @staticmethod
+    def app_log_log(uid='None', tz='0'):
+        file_path = '/'.join((BASE_DIR, 'static/app_log.log'))
+        file = open(file_path, 'a+')
+        file.write("uid:" + uid + "; " + "; tz:" + tz)
+        file.write('\n')
+        file.flush()
+        file.close()