Browse Source

修改【修改设备信息逻辑】,去除UID

tanghongbin 4 years ago
parent
commit
4bf5bdde2b
2 changed files with 10 additions and 0 deletions
  1. 5 0
      Controller/EquipmentManager.py
  2. 5 0
      Controller/EquipmentManagerV3.py

+ 5 - 0
Controller/EquipmentManager.py

@@ -205,11 +205,16 @@ def modifyUserEquipmentInterface(request):
         return response.json(309)
     try:
         deviceData = json.loads(deviceContent)
+
         if deviceData.__contains__('userID_id'):
             asy = threading.Thread(target=ModelService.update_log,
                                    args=(CommonService.get_ip_address(request), userID, 'modifyV0', deviceData, id))
             asy.start()
             return response.json(10, '110')
+
+        if deviceData.__contains__('UID'):
+            del deviceData['UID']
+
         dev_info_qs = Device_Info.objects.filter(userID_id=userID, id=id)
         dev_info_qs.update(**deviceData)
     except Exception as e:

+ 5 - 0
Controller/EquipmentManagerV3.py

@@ -152,11 +152,16 @@ class EquipmentManagerV3(View):
         try:
             # deviceData = json.loads(deviceContent)
             deviceData = eval(deviceContent)
+
             if deviceData.__contains__('userID_id'):
                 asy = threading.Thread(target=ModelService.update_log,
                                        args=(CommonService.get_ip_address(request), userID, 'modifyV3', deviceData, id))
                 asy.start()
                 return response.json(10, '110')
+
+            if deviceData.__contains__('UID'):
+                del deviceData['UID']
+
             # print(deviceData['View_Password'])
             if deviceData.__contains__('View_Password'):
                 deviceData['View_Password'] = self.decode_pwd(deviceData['View_Password'])