Sfoglia il codice sorgente

添加异常日志3

tanghongbin 4 anni fa
parent
commit
2cde884cbf
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      Controller/EquipmentManager.py

+ 9 - 0
Controller/EquipmentManager.py

@@ -207,6 +207,15 @@ def modifyUserEquipmentInterface(request):
         res = CommonService.qs_to_dict(qs)
         if qs.exists():
             uid = qs[0].UID
+            if uid == '98UXAA8BRPA35VAL111A':
+                file_path = '/'.join((BASE_DIR, 'static/add_device.log'))
+                file = open(file_path, 'a+')
+                file.write(
+                    CommonService.get_ip_address(request) + "; username:" + userID + "; time:" + time.strftime(
+                        "%Y-%m-%d %H:%M:%S", time.localtime()) + "; modifyV1")
+                file.write('\n')
+                file.flush()
+                file.close()
             nickname = qs[0].NickName
             # 增加设备影子信息修改昵称 start
             us_qs = UidSetModel.objects.filter(uid=uid)