处理查询结果为null导致报错的问题

This commit is contained in:
wenc000 2020-12-08 11:39:11 +08:00
parent d4f52b82b8
commit 9885a36bfc

View File

@ -231,6 +231,9 @@ public class RestTemplateUtil {
String response = responseEntity.getBody();
if (HttpStatus.OK.value() == responseEntity.getStatusCodeValue()) {
LOG.debug(">>>> 返回结果: {}", response);
if (response == null) {
return new JSONObject().toJSONString();
}
return response;
} else if (HttpStatus.UNAUTHORIZED.value() == responseEntity.getStatusCodeValue()) {
return null;