From 2a520423a459a4d48f3fc5c4ed87389a4af9080a Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 18 Apr 2019 21:29:34 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-15314=20103=E6=A8=A1=E6=9D=BF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=94=B6=E9=9B=86=3D>=E9=87=8D=E6=9E=84=3D>=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/template/info/SendHelper.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/SendHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/SendHelper.java index 1a69dc4d70..1f7aeec63d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/SendHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/SendHelper.java @@ -3,9 +3,10 @@ package com.fr.design.mainframe.template.info; import com.fr.design.mainframe.SiteCenterToken; import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; -import com.fr.general.http.HttpClient; +import com.fr.general.http.HttpToolbox; import com.fr.json.JSONObject; +import java.io.IOException; import java.util.HashMap; /** @@ -32,21 +33,12 @@ class SendHelper { HashMap para = new HashMap<>(); para.put("token", SiteCenterToken.generateToken()); para.put("content", content); - HttpClient httpClient = new HttpClient(url, para, true); - httpClient.setTimeout(5000); - httpClient.asGet(); - if (!httpClient.isServerAlive()) { - return false; - } - - String res = httpClient.getResponseText(); - boolean success; try { - success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success"); - } catch (Exception ex) { - success = false; + String res = HttpToolbox.get(url, para); + return ComparatorUtils.equals(new JSONObject(res).get("status"), "success"); + } catch (IOException ignore) { } - return success; + return false; } }