diff --git a/designer_base/src/com/fr/design/extra/LoginWebBridge.java b/designer_base/src/com/fr/design/extra/LoginWebBridge.java index 6592e1601f..5a23734fcc 100644 --- a/designer_base/src/com/fr/design/extra/LoginWebBridge.java +++ b/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.XMLHelper; import com.fr.design.gui.ilable.UILabel; +import com.fr.general.ComparatorUtils; import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONObject; @@ -108,9 +109,6 @@ public class LoginWebBridge { if (StringUtils.isEmpty(userName)) { return; } - if (StringUtils.isNotEmpty(this.userName)) { - updateMessageCount(); - } this.userName = userName; } @@ -143,15 +141,13 @@ public class LoginWebBridge { if (getMessage.isServerAlive()) { try { String res = getMessage.getResponseText(); - if (res.equals(FAILED_MESSAGE_STATUS)) { - } else { + if (!ComparatorUtils.equals(res, FAILED_MESSAGE_STATUS)) { 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"))); } } - } catch (Exception e) { - FRContext.getLogger().info(e.getMessage()); + } catch (Exception ignore) { } } sleep(CHECK_MESSAGE_TIME); diff --git a/designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java b/designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java index c1101f8005..c2c80aef0f 100644 --- a/designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java +++ b/designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java @@ -38,9 +38,6 @@ public class PluginLoginExecutor implements Executor { @Override public void run(Process process) { String loginResult = LoginWebBridge.getHelper().login(username, password, uiLabel); - if (Integer.valueOf(loginResult) == 0) { - LoginWebBridge.getHelper().updateMessageCount(); - } result = loginResult; } }