|
@@ -63,6 +63,7 @@ class EquipmentManagerV3(View):
|
|
NickName = request_dict.get('NickName', None)
|
|
NickName = request_dict.get('NickName', None)
|
|
View_Account = request_dict.get('View_Account', None)
|
|
View_Account = request_dict.get('View_Account', None)
|
|
View_Password = request_dict.get('View_Password', '')
|
|
View_Password = request_dict.get('View_Password', '')
|
|
|
|
+ encrypt_pass = View_Password
|
|
print("准备解密")
|
|
print("准备解密")
|
|
View_Password = self.decode_pwd(View_Password)
|
|
View_Password = self.decode_pwd(View_Password)
|
|
Type = request_dict.get('Type', None)
|
|
Type = request_dict.get('Type', None)
|
|
@@ -173,7 +174,8 @@ class EquipmentManagerV3(View):
|
|
us_qs = UidSetModel.objects.filter(uid=UID)
|
|
us_qs = UidSetModel.objects.filter(uid=UID)
|
|
|
|
|
|
if us_qs.exists() and us_qs[0].is_alexa == 1:
|
|
if us_qs.exists() and us_qs[0].is_alexa == 1:
|
|
- asy = threading.Thread(target=ModelService.notify_alexa_add, args=(UID, userID, NickName))
|
|
|
|
|
|
+ asy = threading.Thread(target=ModelService.notify_alexa_add,
|
|
|
|
+ args=(UID, userID, NickName, encrypt_pass))
|
|
asy.start()
|
|
asy.start()
|
|
|
|
|
|
# redisObj = RedisObject(db=8)
|
|
# redisObj = RedisObject(db=8)
|
|
@@ -235,6 +237,7 @@ class EquipmentManagerV3(View):
|
|
|
|
|
|
# print(deviceData['View_Password'])
|
|
# print(deviceData['View_Password'])
|
|
if deviceData.__contains__('View_Password'):
|
|
if deviceData.__contains__('View_Password'):
|
|
|
|
+ encrypt_pwd = deviceData['View_Password']
|
|
deviceData['View_Password'] = self.decode_pwd(deviceData['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 = Device_Info.objects.filter(userID_id=userID, id=id)
|
|
dev_info_qs.update(**deviceData)
|
|
dev_info_qs.update(**deviceData)
|
|
@@ -267,7 +270,8 @@ class EquipmentManagerV3(View):
|
|
di_qs = Device_Info.objects.filter(UID=uid)
|
|
di_qs = Device_Info.objects.filter(UID=uid)
|
|
di_qs.update(NickName=nickname)
|
|
di_qs.update(NickName=nickname)
|
|
if deviceData is not None and deviceData.__contains__('NickName') and us_qs[0].is_alexa == 1:
|
|
if deviceData is not None and deviceData.__contains__('NickName') and us_qs[0].is_alexa == 1:
|
|
- asy = threading.Thread(target=ModelService.notify_alexa_add, args=(uid, userID, nickname))
|
|
|
|
|
|
+ password = encrypt_pwd if deviceData.__contains__('View_Password') else ''
|
|
|
|
+ asy = threading.Thread(target=ModelService.notify_alexa_add, args=(uid, userID, nickname, password))
|
|
asy.start()
|
|
asy.start()
|
|
# redisObj = RedisObject(db=8)
|
|
# redisObj = RedisObject(db=8)
|
|
# redisObj.del_data(key='uid_qs_' + userID)
|
|
# redisObj.del_data(key='uid_qs_' + userID)
|