From 8c22eab84b5efcc665af586833113d809773fde5 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 19 Sep 2017 14:45:08 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4652=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=AF=86=E7=A0=81=E6=9C=89=E7=89=B9=E6=AE=8A=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=EF=BC=8C=E6=B2=A1=E6=B3=95=E7=99=BB=E9=99=86?= 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, 13 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 3c25fc7ff..11c48ec8f 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -85,6 +85,7 @@ import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.NoRouteToHostException; import java.net.Socket; +import java.net.URLEncoder; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -157,6 +158,15 @@ public class RemoteEnv extends AbstractEnv { return password; } + // 修复密码中包含特殊字符,无法登录的问题 + private String getEncodedPassword() { + try { + return URLEncoder.encode(password, "UTF-8"); + } catch (UnsupportedEncodingException e) { + return password; + } + } + public void setPassword(String password) { this.password = password; clearUserID(); @@ -382,7 +392,7 @@ public class RemoteEnv extends AbstractEnv { para.put("op", "fr_remote_design"); para.put("cmd", "test_server_connection"); para.put("user", user); - para.put("password", password); + para.put("password", getEncodedPassword()); if (path.startsWith("https") && (!DesignerEnvManager.getEnvManager().isHttps())) { return false; @@ -505,7 +515,7 @@ public class RemoteEnv extends AbstractEnv { para.put("op", "fr_remote_design"); para.put("cmd", "r_sign_in"); para.put("user", user); - para.put("password", password); + para.put("password", getEncodedPassword()); simulaRPC(para, true); @@ -1990,7 +2000,7 @@ public class RemoteEnv extends AbstractEnv { para.put("op", "fr_remote_design"); para.put("cmd", "design_get_designer_version"); para.put("user", user); - para.put("password", password); + para.put("password", getEncodedPassword()); HttpClient client = createHttpMethod(para, true); try {