|
|
@ -711,6 +711,7 @@ public class VideoController extends BaseController { |
|
|
|
JSONObject cameraInfo = JSONObject.parseObject(configService.selectConfigByKey("dc.cameraInfo")); |
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonResult = null; |
|
|
|
OkHttp okHttp = new OkHttp(); |
|
|
|
|
|
|
|
RequestParams requestParams = new RequestParams(); |
|
|
@ -733,7 +734,34 @@ public class VideoController extends BaseController { |
|
|
|
.data(requestParams) // 请求参数
|
|
|
|
.get(); // 请求方法
|
|
|
|
|
|
|
|
return getJsonResult(response,okHttp); |
|
|
|
if (response.body() != null) { |
|
|
|
jsonResult = JSONObject.parseObject(response.body().string()); |
|
|
|
|
|
|
|
if (jsonResult.containsKey("code")) { |
|
|
|
if (HttpStatus.SUCCESS == jsonResult.getInteger("code")) { |
|
|
|
Map<String,Object> data = jsonResult.getJSONObject("data"); |
|
|
|
String fileUrl = data.get("fileUrl").toString(); |
|
|
|
fileUrl = configService.selectConfigByKey("dc.cameraUrl") + fileUrl.substring(UniversalEnum.SEVEN.getNumber()); |
|
|
|
data.put("fileUrl",fileUrl); |
|
|
|
jsonResult.put("data",data); |
|
|
|
} else if (UNAUTHORIZED.equals(jsonResult.getInteger("code"))) { |
|
|
|
getToken(); |
|
|
|
okHttp.post(); |
|
|
|
if (response.body() != null) { |
|
|
|
jsonResult = JSONObject.parseObject(response.body().string()); |
|
|
|
if (HttpStatus.SUCCESS == jsonResult.getInteger("code")) { |
|
|
|
Map<String,Object> data = jsonResult.getJSONObject("data"); |
|
|
|
String fileUrl = data.get("fileUrl").toString(); |
|
|
|
fileUrl = configService.selectConfigByKey("cameraUrl") + fileUrl.substring(UniversalEnum.SEVEN.getNumber()); |
|
|
|
data.put("liveUrl",fileUrl); |
|
|
|
jsonResult.put("data",data); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return jsonResult; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|