From 1fbf9585393180c44a2ba05e2e8be12d55640657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Mon, 6 Oct 2025 09:16:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=88=E6=9D=BF=E5=87=BA=E7=AB=8B=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/gaotao/common/utils/HttpUtils.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/com/gaotao/common/utils/HttpUtils.java b/src/main/java/com/gaotao/common/utils/HttpUtils.java index d844295..aba0b81 100644 --- a/src/main/java/com/gaotao/common/utils/HttpUtils.java +++ b/src/main/java/com/gaotao/common/utils/HttpUtils.java @@ -88,7 +88,7 @@ public class HttpUtils { try { HttpRequest.Builder builder = HttpRequest.newBuilder() .uri(URI.create(url)) - .timeout(Duration.ofSeconds(60)) // 请求超时:60秒 - rqrq + .timeout(Duration.ofSeconds(60)) .POST(HttpRequest.BodyPublishers.ofString(jsonBody)) .header("Content-Type", "application/json"); @@ -98,10 +98,6 @@ public class HttpUtils { HttpResponse response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString()); return handleResponse(response); - } catch (java.net.http.HttpTimeoutException e) { - // 超时异常特殊处理 - rqrq - Thread.currentThread().interrupt(); - throw new RuntimeException("WCS接口响应超时(30秒),请检查WCS服务或网络连接"); } catch (IOException | InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException("POST 请求失败: " + e.getMessage(), e);