From 9885a36bfcd6f3bb02699943fcb289aa223603ac Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Tue, 8 Dec 2020 11:39:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=9F=A5=E8=AF=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E4=B8=BAnull=E5=AF=BC=E8=87=B4=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/cm/common/plugin/utils/RestTemplateUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/utils/RestTemplateUtil.java b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/utils/RestTemplateUtil.java index 97d4264..cac0ee8 100644 --- a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/utils/RestTemplateUtil.java +++ b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/utils/RestTemplateUtil.java @@ -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;