Commit 0b14155a75f955e553f8730447f2cf17a584fe81
1 parent
f1fed762
增加 sendGet 无参判断
Showing
1 changed file
with
2 additions
and
1 deletions
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
... | ... | @@ -19,6 +19,7 @@ import javax.net.ssl.X509TrustManager; |
19 | 19 | import org.slf4j.Logger; |
20 | 20 | import org.slf4j.LoggerFactory; |
21 | 21 | import com.ruoyi.common.constant.Constants; |
22 | +import com.ruoyi.common.utils.StringUtils; | |
22 | 23 | |
23 | 24 | /** |
24 | 25 | * 通用http发送方法 |
... | ... | @@ -55,7 +56,7 @@ public class HttpUtils |
55 | 56 | BufferedReader in = null; |
56 | 57 | try |
57 | 58 | { |
58 | - String urlNameString = url + "?" + param; | |
59 | + String urlNameString = StringUtils.isNotBlank(param) ? url + "?" + param : url; | |
59 | 60 | log.info("sendGet - {}", urlNameString); |
60 | 61 | URL realUrl = new URL(urlNameString); |
61 | 62 | URLConnection connection = realUrl.openConnection(); |
... | ... |