Browse Source

REPORT-4652 远程设计密码有特殊字符,没法登陆

master
plough 7 years ago
parent
commit
8c22eab84b
  1. 16
      designer_base/src/com/fr/env/RemoteEnv.java

16
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -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 {

Loading…
Cancel
Save