Browse Source

设备获取证书 返回重复值2

chenshibin 4 years ago
parent
commit
5e2bc77501
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Controller/IotCoreController.py

+ 2 - 2
Controller/IotCoreController.py

@@ -135,13 +135,13 @@ class IotCoreView(View):
                     return response.json(0, {'res': res})
             else:
                 dev_qs = Device_Info.objects.filter(UID=uid)
-                iot = iotdeviceInfoModel.objects.get(UID=uid)
+                iot = iotdeviceInfoModel.objects.get(uid=uid)
                 res = {
                     'certificateId': iot.certificateId,
                     'certificatePem': iot.certificatePem,
                     'publicKey': iot.publicKey,
                     'privateKey': iot.privateKey,
-                    'endpoint': dev_qs[0]['endpoint']
+                    'endpoint': dev_qs[0].endpoint
                 }
                 # print('此设备已注册证书')
                 return response.json(0, {'res': res})