Browse Source

Merge pull request #251 in BA/design from ~VITO/design:master to master

* commit '80bfeba2f59f1de4be6a3e2b52a2caeea906bab7':
  bugfix:论坛域名改变,导致登陆成功标志出错
master
superman 8 years ago
parent
commit
df8e915429
  1. 4
      designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java

4
designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java

@ -36,7 +36,6 @@ public class BBSLoginDialog extends UIDialog {
private static final int DIALOG_WIDTH = 400; private static final int DIALOG_WIDTH = 400;
private static final int DIALOG_HEIGHT = 200; private static final int DIALOG_HEIGHT = 200;
private static final String LOGIN_SUCCESS_FLAG = "http://bbs.finereport.com";
private static final Font DEFAULT_FONT = FRFont.getInstance(FRFont.DEFAULT_FONTNAME, 0, 14); private static final Font DEFAULT_FONT = FRFont.getInstance(FRFont.DEFAULT_FONTNAME, 0, 14);
private static final int TIME_OUT = 10000; private static final int TIME_OUT = 10000;
@ -287,12 +286,13 @@ public class BBSLoginDialog extends UIDialog {
FRLogger.getLogger().error(e.getMessage()); FRLogger.getLogger().error(e.getMessage());
} }
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.login") + "&username=" + username + "&password=" + password; String url = SiteCenter.getInstance().acquireUrlByKind("bbs.login") + "&username=" + username + "&password=" + password;
String loginSuccessFlag = SiteCenter.getInstance().acquireUrlByKind("bbs");
HttpClient client = new HttpClient(url); HttpClient client = new HttpClient(url);
client.setTimeout(TIME_OUT); client.setTimeout(TIME_OUT);
if (client.getResponseCodeNoException() == HttpURLConnection.HTTP_OK) { if (client.getResponseCodeNoException() == HttpURLConnection.HTTP_OK) {
try { try {
String res = client.getResponseText(EncodeConstants.ENCODING_GBK); String res = client.getResponseText(EncodeConstants.ENCODING_GBK);
if (res.contains(LOGIN_SUCCESS_FLAG)) { if (res.contains(loginSuccessFlag)) {
return true; return true;
} }
} catch (Exception e) { } catch (Exception e) {

Loading…
Cancel
Save