Browse Source

REPORT-2354 不从后台自动登录,切换环境进行登录

master
kerry 7 years ago
parent
commit
3f3d4a563d
  1. 16
      designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java

16
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.design.mainframe.DesignerContext;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -45,6 +47,7 @@ public class UserInfoPane extends BasicPane{
private UserInfoLabel userInfoLabel; private UserInfoLabel userInfoLabel;
public UserInfoLabel getUserInfoLabel() { public UserInfoLabel getUserInfoLabel() {
return userInfoLabel; return userInfoLabel;
} }
@ -64,18 +67,15 @@ public class UserInfoPane extends BasicPane{
this.userInfoLabel = new UserInfoLabel(this); this.userInfoLabel = new UserInfoLabel(this);
this.markUnSignIn(); this.markUnSignIn();
autoLogin(); addEnvChangedListener();
autoPushLoginDialog(); autoPushLoginDialog();
this.add(userInfoLabel, BorderLayout.CENTER); this.add(userInfoLabel, BorderLayout.CENTER);
} }
// 后台自动登录
private void autoLogin(){
Thread bbsAutoLoginThread = new Thread(new Runnable() {
@Override private void addEnvChangedListener(){
public void run() { GeneralContext.addEnvChangedListener(new EnvChangedListener() {
public void envChanged() {
String username = ConfigManager.getProviderInstance().getBbsUsername(); String username = ConfigManager.getProviderInstance().getBbsUsername();
if (StringUtils.isEmpty(username)){ if (StringUtils.isEmpty(username)){
markUnSignIn(); markUnSignIn();
@ -84,8 +84,8 @@ public class UserInfoPane extends BasicPane{
} }
} }
}); });
bbsAutoLoginThread.start();
} }
// 计算xml保存的上次弹框时间和当前时间的时间差 // 计算xml保存的上次弹框时间和当前时间的时间差
private int getDiffFromLastLogin(){ private int getDiffFromLastLogin(){

Loading…
Cancel
Save