From 0b14155a75f955e553f8730447f2cf17a584fe81 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 9 Oct 2021 11:42:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20sendGet=20=E6=97=A0?= =?UTF-8?q?=E5=8F=82=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/common/utils/http/HttpUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java index 20037432..c920f5b1 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java @@ -19,6 +19,7 @@ import javax.net.ssl.X509TrustManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.StringUtils; /** * 通用http发送方法 @@ -55,7 +56,7 @@ public class HttpUtils BufferedReader in = null; try { - String urlNameString = url + "?" + param; + String urlNameString = StringUtils.isNotBlank(param) ? url + "?" + param : url; log.info("sendGet - {}", urlNameString); URL realUrl = new URL(urlNameString); URLConnection connection = realUrl.openConnection();