Browse Source

Merge pull request #902 in BA/design from ~NEIL/design:dev to dev

* commit '277e0bfb48379930ee0e88f2c7cd633ad98b9a36':
  REPORT-2801 关掉设计器获取论坛消息.
master
superman 8 years ago
parent
commit
d63d1340b7
  1. 12
      designer_base/src/com/fr/design/extra/LoginWebBridge.java
  2. 3
      designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java

12
designer_base/src/com/fr/design/extra/LoginWebBridge.java

@ -6,6 +6,7 @@ import com.fr.design.dialog.UIDialog;
import com.fr.design.extra.ucenter.Client; import com.fr.design.extra.ucenter.Client;
import com.fr.design.extra.ucenter.XMLHelper; import com.fr.design.extra.ucenter.XMLHelper;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.general.ComparatorUtils;
import com.fr.general.SiteCenter; import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
@ -108,9 +109,6 @@ public class LoginWebBridge {
if (StringUtils.isEmpty(userName)) { if (StringUtils.isEmpty(userName)) {
return; return;
} }
if (StringUtils.isNotEmpty(this.userName)) {
updateMessageCount();
}
this.userName = userName; this.userName = userName;
} }
@ -143,15 +141,13 @@ public class LoginWebBridge {
if (getMessage.isServerAlive()) { if (getMessage.isServerAlive()) {
try { try {
String res = getMessage.getResponseText(); String res = getMessage.getResponseText();
if (res.equals(FAILED_MESSAGE_STATUS)) { if (!ComparatorUtils.equals(res, FAILED_MESSAGE_STATUS)) {
} else {
JSONObject jo = new JSONObject(res); JSONObject jo = new JSONObject(res);
if (jo.getString("status").equals(SUCCESS_MESSAGE_STATUS)) { if (SUCCESS_MESSAGE_STATUS.equals(jo.optString("status"))) {
setMessageCount(Integer.parseInt(jo.getString("message"))); setMessageCount(Integer.parseInt(jo.getString("message")));
} }
} }
} catch (Exception e) { } catch (Exception ignore) {
FRContext.getLogger().info(e.getMessage());
} }
} }
sleep(CHECK_MESSAGE_TIME); sleep(CHECK_MESSAGE_TIME);

3
designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java

@ -38,9 +38,6 @@ public class PluginLoginExecutor implements Executor {
@Override @Override
public void run(Process<String> process) { public void run(Process<String> process) {
String loginResult = LoginWebBridge.getHelper().login(username, password, uiLabel); String loginResult = LoginWebBridge.getHelper().login(username, password, uiLabel);
if (Integer.valueOf(loginResult) == 0) {
LoginWebBridge.getHelper().updateMessageCount();
}
result = loginResult; result = loginResult;
} }
} }

Loading…
Cancel
Save