mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 23:31:52 +08:00
修复 匿名用户会被鉴定为anonymousUser
This commit is contained in:
parent
61c7687473
commit
4749090fc0
@ -20,7 +20,8 @@ import java.util.Set;
|
||||
*/
|
||||
public class SecurityFrameworkUtils {
|
||||
|
||||
private SecurityFrameworkUtils() {}
|
||||
private SecurityFrameworkUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 从请求中,获得认证 Token
|
||||
@ -56,7 +57,7 @@ public class SecurityFrameworkUtils {
|
||||
if (authentication == null) {
|
||||
return null;
|
||||
}
|
||||
return (LoginUser) authentication.getPrincipal();
|
||||
return authentication.getPrincipal() instanceof LoginUser ? (LoginUser) authentication.getPrincipal() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user