From 3f3d4a563dd65086d8711faf72147cb83fcd3c6f Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 23 Aug 2017 15:33:35 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-2354=20=E4=B8=8D=E4=BB=8E=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E8=87=AA=E5=8A=A8=E7=99=BB=E5=BD=95=EF=BC=8C=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E7=8E=AF=E5=A2=83=E8=BF=9B=E8=A1=8C=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/bbs/UserInfoPane.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java index 711fd634d..32efda9ce 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java @@ -18,7 +18,9 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.mainframe.DesignerContext; import com.fr.general.DateUtils; import com.fr.general.FRLogger; +import com.fr.general.GeneralContext; import com.fr.general.Inter; +import com.fr.stable.EnvChangedListener; import com.fr.stable.StringUtils; @@ -45,6 +47,7 @@ public class UserInfoPane extends BasicPane{ private UserInfoLabel userInfoLabel; + public UserInfoLabel getUserInfoLabel() { return userInfoLabel; } @@ -64,18 +67,15 @@ public class UserInfoPane extends BasicPane{ this.userInfoLabel = new UserInfoLabel(this); this.markUnSignIn(); - autoLogin(); + addEnvChangedListener(); autoPushLoginDialog(); this.add(userInfoLabel, BorderLayout.CENTER); } - - // 后台自动登录 - private void autoLogin(){ - Thread bbsAutoLoginThread = new Thread(new Runnable() { - @Override - public void run() { + private void addEnvChangedListener(){ + GeneralContext.addEnvChangedListener(new EnvChangedListener() { + public void envChanged() { String username = ConfigManager.getProviderInstance().getBbsUsername(); if (StringUtils.isEmpty(username)){ markUnSignIn(); @@ -84,8 +84,8 @@ public class UserInfoPane extends BasicPane{ } } }); - bbsAutoLoginThread.start(); } + // 计算xml保存的上次弹框时间和当前时间的时间差 private int getDiffFromLastLogin(){