diff --git a/huaheng-wms-core/src/main/java/org/jeecg/utils/OkHttpUtils.java b/huaheng-wms-core/src/main/java/org/jeecg/utils/OkHttpUtils.java index c71e201..4bf7af4 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/utils/OkHttpUtils.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/utils/OkHttpUtils.java @@ -112,18 +112,18 @@ public class OkHttpUtils { response = HTTP_CLIENT.newCall(request).execute(); result = response.body().string(); } catch (Exception e) { - log.error("执行GET请求异常,url:{},header:{},param:{},errorMessage:{}", url, JSON.toJSONString(headers), param, ExceptionUtil.getMessage(e), e); + String errorString = StrUtil.format("执行GET请求异常,url: {},{}", url, ExceptionUtil.getMessage(e)); + log.error(errorString, e); ApiLoggerAspect.setApiLogException(apiLog, e); - throw ExceptionUtil.convertFromOrSuppressedThrowable(e, JeecgBootException.class); + throw new JeecgBootException(errorString, e); } finally { ApiLoggerAspect.finishApiLog(apiLog, response, result); } // 调用成功 if (response.isSuccessful() && Objects.nonNull(response.body())) { - log.info("执行GET请求成功,url:{},header:{},param:{},result:{}", url, JSON.toJSONString(headers), param, result); + log.info("执行GET请求成功,url: {},result: {}", url, result); } else { - throw new JeecgBootException(StrUtil.format("执行GET请求失败,url:{},header:{},param:{},responseCode:{},responseMessage:{}", url, JSON.toJSONString(headers), - param, response.code(), response.message())); + throw new JeecgBootException(StrUtil.format("执行GET请求失败,url: {},responseCode: {},responseMessage: {}", url, response.code(), response.message())); } return result; } @@ -152,18 +152,19 @@ public class OkHttpUtils { response = HTTP_CLIENT.newCall(request).execute(); result = response.body().string(); } catch (Exception e) { - log.error("执行POST请求异常,url:{},header:{},param:{},errorMessage:{}", url, JSON.toJSONString(headers), jsonString, ExceptionUtil.getMessage(e), e); + String errorString = StrUtil.format("执行POST请求异常,url: {},{}", url, ExceptionUtil.getMessage(e)); + log.error(errorString, e); ApiLoggerAspect.setApiLogException(apiLog, e); - throw ExceptionUtil.convertFromOrSuppressedThrowable(e, JeecgBootException.class); + throw new JeecgBootException(errorString, e); } finally { ApiLoggerAspect.finishApiLog(apiLog, response, result); } // 调用成功 if (response.isSuccessful() && Objects.nonNull(response.body())) { - log.info("执行POST请求成功,url:{},header:{},param:{},result:{}", url, JSON.toJSONString(headers), jsonString, result); + log.info("执行POST请求成功,url: {},result: {}", url, result); } else { - throw new JeecgBootException(StrUtil.format("执行POST请求失败,url:{},header:{},param:{},responseCode:{},responseMessage:{}", url, JSON.toJSONString(headers), - jsonString, response.code(), response.message())); + throw new JeecgBootException(StrUtil.format("执行POST请求失败,url: {},responseCode: {},responseMessage: {}", url, JSON.toJSONString(headers), jsonString, + response.code(), response.message())); } return result; }