|
@@ -135,8 +135,9 @@ class EquipmentManagerV3(View):
|
|
|
return response.json(309)
|
|
|
try:
|
|
|
deviceData = json.loads(deviceContent)
|
|
|
- print(deviceData['View_Password'])
|
|
|
- deviceData['View_Password'] = self.decode_pwd(deviceData['View_Password'])
|
|
|
+ # print(deviceData['View_Password'])
|
|
|
+ if deviceData.__contains__('View_Password'):
|
|
|
+ deviceData['View_Password'] = self.decode_pwd(deviceData['View_Password'])
|
|
|
dev_info_qs = Device_Info.objects.filter(userID_id=userID, id=id)
|
|
|
dev_info_qs.update(**deviceData)
|
|
|
except Exception as e:
|
|
@@ -328,18 +329,22 @@ class EquipmentManagerV3(View):
|
|
|
|
|
|
if NickName:
|
|
|
# print('NickName搜索缓存')
|
|
|
+ data = []
|
|
|
for index, item in enumerate(result):
|
|
|
if NickName == item['NickName']:
|
|
|
# 加密
|
|
|
item['View_Password'] = self.encrypt_pwd(item['View_Password'])
|
|
|
- return response.json(0, item)
|
|
|
+ data.append(item)
|
|
|
+ return response.json(0, data)
|
|
|
if uid:
|
|
|
# print('uid搜索缓存')
|
|
|
+ data = []
|
|
|
for index, item in enumerate(result):
|
|
|
if uid == item['UID']:
|
|
|
# 加密
|
|
|
item['View_Password'] = self.encrypt_pwd(item['View_Password'])
|
|
|
- return response.json(0, item)
|
|
|
+ data.append(item)
|
|
|
+ return response.json(0, data)
|
|
|
items = []
|
|
|
# print('缓存分页')
|
|
|
for index, item in enumerate(result):
|