From fba3595d78074ec212b7f56d25e2d86ab8b05194 Mon Sep 17 00:00:00 2001 From: vito Date: Fri, 10 Nov 2017 15:10:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20SonarQube?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/bbs/UserInfoLabel.java | 5 +++++ designer_base/src/com/fr/design/extra/LoginWebBridge.java | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java index c985fc6e5d..940bc9b4f1 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -87,6 +87,10 @@ public class UserInfoLabel extends UILabel { } public UserInfoLabel(UserInfoPane userInfoPane) { + init(userInfoPane); + } + + private void init(UserInfoPane userInfoPane) { this.userInfoPane = userInfoPane; String userName = ConfigManager.getProviderInstance().getBbsUsername(); @@ -158,6 +162,7 @@ public class UserInfoLabel extends UILabel { showWindow.invoke(instance, SiteCenter.getInstance().acquireUrlByKind("bbs.popup")); DesignerEnvManager.getEnvManager().setLastShowBBSNewsTime(DateUtils.DATEFORMAT2.format(new Date())); } catch (Throwable ignored) { + // ignored } } }); diff --git a/designer_base/src/com/fr/design/extra/LoginWebBridge.java b/designer_base/src/com/fr/design/extra/LoginWebBridge.java index f946a7cc60..330b9fc033 100644 --- a/designer_base/src/com/fr/design/extra/LoginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/LoginWebBridge.java @@ -8,6 +8,7 @@ import com.fr.design.extra.exe.PluginLoginExecutor; 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; @@ -282,9 +283,9 @@ public class LoginWebBridge { try { JSONObject jo = new JSONObject(userInfo); String status = jo.get("status").toString(); - if (status.equals(LOGIN_SUCCESS)) { + if (ComparatorUtils.equals(status, LOGIN_SUCCESS)) { String username = jo.get("username").toString(); - int uid = Integer.parseInt(jo.get("uid") == null ? "" : jo.get("uid").toString()); + int uid = Integer.parseInt(jo.get("uid") == null ? StringUtils.EMPTY : jo.get("uid").toString()); closeQQWindow(); loginSuccess(username); @@ -293,7 +294,7 @@ public class LoginWebBridge { list.add(username); list.add(StringUtils.EMPTY); BBSLoginUtils.bbsLogin(list); - } else if (status.equals(LOGIN_FAILED)) { + } else if (ComparatorUtils.equals(status, LOGIN_FAILED)) { //账号没有QQ授权 closeQQWindow(); try {