```
登录的时候
Subject subject = SecurityUtils.getSubject();
subject.login(new AuthAccountToken(account));
此时是有值的
再次调用
AuthPrincipal user = this.getCurrentPrincipal();
```
user就是空值了,请问该怎么去查
```
登录的时候
Subject subject = SecurityUtils.getSubject();
subject.login(new AuthAccountToken(account));
此时是有值的
再次调用
AuthPrincipal user = this.getCurrentPrincipal();
```
user就是空值了,请问该怎么去查
就这玩意儿
Subject subject = SecurityUtils.getSubject();
Session session = subject.getSession();
PrincipalCollection principals = (PrincipalCollection)session.getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY);
if (null == principals) return null;
AuthPrincipal principal = (AuthPrincipal)principals.getPrimaryPrincipal();
return principal;