|
@@ -68,13 +68,16 @@ class EquipmentManagerV3(View):
|
|
|
encrypt_pass = View_Password
|
|
|
print("准备解密")
|
|
|
View_Password = self.decode_pwd(View_Password)
|
|
|
- Type = int(request_dict.get('Type', None))
|
|
|
- ChannelIndex = int(request_dict.get('ChannelIndex', None))
|
|
|
+ Type = request_dict.get('Type', None)
|
|
|
+ ChannelIndex = request_dict.get('ChannelIndex', None)
|
|
|
version = request_dict.get('version', '')
|
|
|
isCheckMainUser = request_dict.get('isCheckMainUser', None)
|
|
|
isMainUserExists = False
|
|
|
- if not all([UID, NickName, View_Account]): # Type和ChannelIndex可能为0
|
|
|
- return response.json(444, {'param': 'UID, NickName, View_Account'})
|
|
|
+ if not all([UID, NickName, View_Account, Type, ChannelIndex]): # Type和ChannelIndex可能为0
|
|
|
+ return response.json(444, {'param': 'UID, NickName, View_Account, Type, ChannelIndex'})
|
|
|
+
|
|
|
+ Type = int(Type)
|
|
|
+ ChannelIndex = int(ChannelIndex)
|
|
|
|
|
|
re_uid = re.compile(r'^[A-Za-z0-9]{14,20}$')
|
|
|
if not re_uid.match(UID):
|
|
@@ -226,13 +229,10 @@ class EquipmentManagerV3(View):
|
|
|
|
|
|
iotqs = iotdeviceInfoModel.objects.filter(serial_number=dvql[0]['serial_number'])
|
|
|
if iotqs.exists():
|
|
|
- res['iot'].append(
|
|
|
- {
|
|
|
+ res['iot'] = {
|
|
|
'endpoint': iotqs[0].endpoint,
|
|
|
'token_iot_number': iotqs[0].endpoint
|
|
|
-
|
|
|
- }
|
|
|
- )
|
|
|
+ }
|
|
|
|
|
|
return response.json(0, res)
|
|
|
|