From 716f2a8b25bbb03ab8589cd5c45af27e7c726be8 Mon Sep 17 00:00:00 2001 From: vito Date: Fri, 22 Sep 2017 15:35:32 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-3686=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E8=AF=B7=E6=B1=82=E6=B2=A1=E6=9C=89=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=202/2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 41e4860d2..2188b322b 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -175,12 +175,8 @@ public class RemoteEnv extends AbstractEnv { * 根据nameValuePairs,也就是参数对,生成PostMethod,不同之处在于,参数拼在path后面,不是method.addParameters */ private HttpClient createHttpMethod2(HashMap para) throws EnvException { - StringBuilder sb = new StringBuilder(path); - - sb.append('?'); - sb.append("id=").append(createUserID()); - - return new HttpClient(sb.toString(), para, true); + String methodPath = path + '?' + "id=" + createUserID(); + return new HttpClient(methodPath, para, true); } @@ -362,7 +358,7 @@ public class RemoteEnv extends AbstractEnv { Inter.getLocText(new String[]{"Datasource-Connection_failed", "Registration-User_Name", "Password", "Error"}, new String[]{",", "", "", "!"}) , Inter.getLocText("FR-Server-All_Error"), JOptionPane.ERROR_MESSAGE); return false; - } else if (res.indexOf("RegistEditionException") != -1) { + } else if (res.contains("RegistEditionException")) { if (needMessage) { JOptionPane.showMessageDialog(parentComponent, Inter.getLocText(new String[]{"Datasource-Connection_failed", "Version-does-not-support"}, new String[]{",", "!"})); } else { @@ -415,9 +411,8 @@ public class RemoteEnv extends AbstractEnv { para.put("op", "fr_remote_design"); para.put("cmd", "heart_beat"); para.put("user", user); - para.put("userid", userID); - HttpClient client = createHttpMethod(para, true); + HttpClient client = createHttpMethod(para); execute4InputStream(client); //这做法不好, 30秒刷一次, 刷新的时候会重新构建树, 构建完会把子节点都收缩起来, 效果太差. @@ -552,7 +547,7 @@ public class RemoteEnv extends AbstractEnv { if (resJSON == null) { return false; } - if (resJSON.indexOf("RegistEditionException") != -1) { + if (resJSON.contains("RegistEditionException")) { JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Lic_does_not_Support_Remote")); return false; }