|
@@ -134,7 +134,16 @@ class IotCoreView(View):
|
|
|
Thingname=res[1]['ThingName'])
|
|
|
return response.json(0, {'res': res})
|
|
|
else:
|
|
|
+ dev_qs = Device_Info.objects.filter(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']
|
|
|
+ }
|
|
|
# print('此设备已注册证书')
|
|
|
- return response.json(10042)
|
|
|
+ return response.json(0, {'res': res})
|
|
|
else:
|
|
|
return response.json(444)
|