From 26d1f59f0266672398975ba0337bb3d8267c2d95 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 12 十月 2026 15:36:52 +0800
Subject: [PATCH] 满意度扫码BUG修改

---
 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 0310368..971ef13 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
@@ -395,14 +395,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