|
@@ -431,11 +431,11 @@ class oa2DiscoveryDevice(TemplateView):
|
|
logger = logging.getLogger('django')
|
|
logger = logging.getLogger('django')
|
|
logger.info('--------{} 开始搜索设备--------'.format(skill_name))
|
|
logger.info('--------{} 开始搜索设备--------'.format(skill_name))
|
|
|
|
|
|
|
|
+ response = ResObject()
|
|
user_qs = UserModel.objects.filter(access_token=access_token)
|
|
user_qs = UserModel.objects.filter(access_token=access_token)
|
|
if not user_qs.exists():
|
|
if not user_qs.exists():
|
|
- return JsonResponse({'错误': '用户数据不存在'})
|
|
|
|
|
|
+ return response.json(500, res={'msg': '用户数据不存在'})
|
|
|
|
|
|
- response = ResObject()
|
|
|
|
user = user_qs[0]
|
|
user = user_qs[0]
|
|
userID = user.userID
|
|
userID = user.userID
|
|
logger.info('userID: {}'.format(userID))
|
|
logger.info('userID: {}'.format(userID))
|
|
@@ -485,7 +485,7 @@ class oa2DiscoveryDevice(TemplateView):
|
|
logger.info('服务器响应: {}'.format(res_json))
|
|
logger.info('服务器响应: {}'.format(res_json))
|
|
|
|
|
|
if res_json['result_code'] != 0:
|
|
if res_json['result_code'] != 0:
|
|
- return response.json(0, res={'msg': 'error'})
|
|
|
|
|
|
+ return response.json(500, res={'msg': '请求业务服务器接口result_code不为0'})
|
|
|
|
|
|
uid_arr = res_json['result']['uid_arr']
|
|
uid_arr = res_json['result']['uid_arr']
|
|
rtko = tkObject(rank=1)
|
|
rtko = tkObject(rank=1)
|
|
@@ -532,7 +532,7 @@ class oa2DiscoveryDevice(TemplateView):
|
|
'modelName': 'P1425-LE',
|
|
'modelName': 'P1425-LE',
|
|
'authorizationTypes': ['NONE'],
|
|
'authorizationTypes': ['NONE'],
|
|
'manufacturerId': 'zosi-ACCC8E5E7513',
|
|
'manufacturerId': 'zosi-ACCC8E5E7513',
|
|
- 'resolutions': [{'width': 1280, 'height': 720}],
|
|
|
|
|
|
+ 'resolutions': [{'width': 640, 'height': 360}],
|
|
}
|
|
}
|
|
res_json.append(ur_data)
|
|
res_json.append(ur_data)
|
|
user.uid_rtsp.add(*uid_rtsp_id_list)
|
|
user.uid_rtsp.add(*uid_rtsp_id_list)
|