|
@@ -41,7 +41,7 @@ class EquipmentManagerV3(View):
|
|
|
elif operation == 'query':
|
|
|
return self.do_query(userID, request_dict, response)
|
|
|
elif operation == 'modify':
|
|
|
- return self.do_modify(userID, request_dict, response)
|
|
|
+ return self.do_modify(userID, request_dict, response, request)
|
|
|
else:
|
|
|
return response.json(414)
|
|
|
else:
|
|
@@ -73,6 +73,13 @@ class EquipmentManagerV3(View):
|
|
|
return response.json(174)
|
|
|
else:
|
|
|
is_exist.delete()
|
|
|
+ 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()) + "; addV3")
|
|
|
+ file.write('\n')
|
|
|
+ file.flush()
|
|
|
+ file.close()
|
|
|
# is_bind = Device_Info.objects.filter(UID=UID, isShare=False)
|
|
|
# # 判断是否有已绑定用户
|
|
|
# if is_bind:
|
|
@@ -132,7 +139,7 @@ class EquipmentManagerV3(View):
|
|
|
else:
|
|
|
return response.json(444, {'param': 'UID,NickName,View_Account,View_Password,Type,ChannelIndex'})
|
|
|
|
|
|
- def do_modify(self, userID, request_dict, response):
|
|
|
+ def do_modify(self, userID, request_dict, response, request):
|
|
|
token = request_dict.get('token', None)
|
|
|
deviceContent = request_dict.get('content', None)
|
|
|
id = request_dict.get('id', None)
|
|
@@ -161,6 +168,15 @@ class EquipmentManagerV3(View):
|
|
|
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()) + "; modifyV3")
|
|
|
+ file.write('\n')
|
|
|
+ file.flush()
|
|
|
+ file.close()
|
|
|
nickname = qs[0].NickName
|
|
|
# 增加设备影子信息修改昵称 start
|
|
|
us_qs = UidSetModel.objects.filter(uid=uid)
|