This commit is contained in:
pengjie 2024-11-11 10:11:52 +08:00
parent 2abd834444
commit cefed27c64

View File

@ -67,16 +67,21 @@ public class CameraPreview {
/**
* STEP6调用接口
*/
String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null,
contentType, header);// post请求application/json类型参数
JSONObject jsonResult = JSONObject.parseObject(result);
if (result != null) {
String code = jsonResult.getString("code");
if (!code.equals("0")) {
log.error("调用海康开发平台接口出现错误,请求接口:" + requestUrl + "请求参数 " + body + "返回错误码:" + code);
jsonResult = null;
try {
String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null,
contentType, header);// post请求application/json类型参数
JSONObject jsonResult = JSONObject.parseObject(result);
if (result != null) {
String code = jsonResult.getString("code");
if (!code.equals("0")) {
log.error("调用海康开发平台接口出现错误,请求接口:" + requestUrl + "请求参数 " + body + "返回错误码:" + code);
jsonResult = null;
}
}
return jsonResult;
} catch (Exception e) {
log.error("调用海康接口错误" + e.getMessage());
}
return jsonResult;
return null;
}
}