|
|
@@ -309,7 +309,7 @@ def add_camera(request):
|
|
|
elif code == "LV1001":
|
|
|
# 如直播地址已存在,则需要查询直播地址列表
|
|
|
live_data = getLive(appId, appSecret, device_id, camera_channel)
|
|
|
- coverUrl = device_live_data["result"]["data"]["streams"][0]["coverUrl"]
|
|
|
+ coverUrl = live_data["result"]["data"]["streams"][0]["coverUrl"]
|
|
|
if live_data["result"]["code"] == "0":
|
|
|
try:
|
|
|
live_path = live_data["result"]["data"]["streams"][0]["hls"]
|
|
|
@@ -347,9 +347,10 @@ def add_camera(request):
|
|
|
else:
|
|
|
raise PortError("","Token过期,设备激活失败")
|
|
|
try:
|
|
|
- MongoDevice.objects.create(device_id=device_ids,device_type_id=6,addtime=now_time,device_code=1,uptime=now_time)
|
|
|
+ MongoDevice.objects.create(device_id=device_ids,device_type_id=6,addtime=now_time,device_code=1,uptime=now_time, jk_live_img=coverUrl)
|
|
|
MongoCameraData.objects.create(device_id=device_ids,device_info=device_info,addtime=now_time,camera_playback=camera_playback,account_id=account_id)
|
|
|
except Exception as e:
|
|
|
+ print(e)
|
|
|
raise PortError(" ", "添加设备失败")
|
|
|
return True
|
|
|
|