From b2d07267ecf8f5c5a95de7233825bbf08f45270d Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 14 Mar 2018 14:58:13 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-7121=208.0=E5=86=92=E7=83=9F=EF=BC=9A?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E6=8A=A5=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index ced9fb0d51..ad71993af3 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -222,15 +222,15 @@ public class RemoteEnv extends AbstractEnv { private HttpClient createHttpMethod(HashMap para, boolean isSignIn) throws EnvException, UnsupportedEncodingException { String methodPath = this.path; if (!isSignIn) { - methodPath = methodPath + "?id=" + createUserID(); + return createHttpClient(para); } - return new HttpClient(methodPath, para); + return new HttpClient(methodPath, para, true); } /** * 根据nameValuePairs,也就是参数对,生成PostMethod,不同之处在于,参数拼在path后面,不是method.addParameters */ - private HttpClient createHttpMethod2(HashMap para) throws EnvException { + private HttpClient createHttpClient(HashMap para) throws EnvException { StringBuilder sb = new StringBuilder(path); sb.append('?'); @@ -314,7 +314,7 @@ public class RemoteEnv extends AbstractEnv { * @throws Exception 异常 */ private boolean postBytes2Server(byte[] bytes, HashMap para) throws Exception { - HttpClient client = createHttpMethod2(para); + HttpClient client = createHttpClient(para); client.setContent(bytes); execute4InputStream(client); @@ -1331,7 +1331,7 @@ public class RemoteEnv extends AbstractEnv { * @throws Exception 异常 */ public InputStream postBytes2ServerB(byte[] bytes, HashMap para) throws Exception { - HttpClient client = createHttpMethod2(para); + HttpClient client = createHttpClient(para); client.setContent(bytes); return execute4InputStream(client); } @@ -1577,7 +1577,7 @@ public class RemoteEnv extends AbstractEnv { } try { - HttpClient client = createHttpMethod2(out.getNameValuePairs()); + HttpClient client = createHttpClient(out.getNameValuePairs()); client.setContent(out.getOut().toByteArray()); String res = stream2String(execute4InputStream(client)); if (StringUtils.isNotEmpty(res)) { @@ -1616,7 +1616,7 @@ public class RemoteEnv extends AbstractEnv { XMLTools.writeOutputStreamXML(mgr, out); try { - HttpClient client = createHttpMethod2(out.getNameValuePairs()); + HttpClient client = createHttpClient(out.getNameValuePairs()); client.setContent(out.getOut().toByteArray()); String res = stream2String(execute4InputStream(client)); if (StringUtils.isNotEmpty(res)) { @@ -1686,7 +1686,7 @@ public class RemoteEnv extends AbstractEnv { para.put("schema", schema); para.put("tableName", tableName); - HttpClient client = createHttpMethod2(para); + HttpClient client = createHttpClient(para); InputStream input = execute4InputStream(client); if (input == null) {