From d9281d43e27ab6c510d390ddb26eaffc8ccc1add Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期三, 11 十一月 2026 14:04:52 +0800
Subject: [PATCH] 妇幼-补充住院随访档案生成日志、完成事件及自检文件
---
ruoyi-common/src/main/java/com/ruoyi/common/utils/HttpUtil.java | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/HttpUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/HttpUtil.java
index 3880900..2c73634 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/HttpUtil.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/HttpUtil.java
@@ -415,14 +415,18 @@
// 鑾峰彇鍝嶅簲鐮�
int responseCode = connection.getResponseCode();
+ log.info("postFormRequest 鍝嶅簲鐮侊細{}锛寀rl锛歿}", responseCode, fullUrl);
- // 璇诲彇鍝嶅簲
+ // 璇诲彇鍝嶅簲锛堥潪200鏃秂rrorStream鍙兘涓簄ull锛岄伩鍏峃PE锛�
StringBuilder response = new StringBuilder();
- if (responseCode == HttpURLConnection.HTTP_OK) {
- reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
- } else {
- reader = new BufferedReader(new InputStreamReader(connection.getErrorStream()));
+ InputStream respStream = responseCode == HttpURLConnection.HTTP_OK
+ ? connection.getInputStream()
+ : connection.getErrorStream();
+ if (respStream == null) {
+ log.warn("postFormRequest 鍝嶅簲浣撲负绌猴紝鍝嶅簲鐮侊細{}锛寀rl锛歿}", responseCode, fullUrl);
+ return "";
}
+ reader = new BufferedReader(new InputStreamReader(respStream));
String line;
while ((line = reader.readLine()) != null) {
--
Gitblit v1.9.3