Browse Source

Merge pull request #1258 in BA/design from ~PLOUGH/design:release/8.0 to release/8.0

* commit '8c22eab84b5efcc665af586833113d809773fde5':
  REPORT-4652 远程设计密码有特殊字符,没法登陆
master
superman 7 years ago
parent
commit
39ef4ca2d9
  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