if (!SecurityContextHolder.getContext().getAuthentication().getName().
equals("anonymousUser")) {
//用户已登录
}else{
//用户未登录
}
SpringSecurity判断用户是否登陆
发布于 2018-05-31 3462 次阅读
发布于 2018-05-31 3462 次阅读
if (!SecurityContextHolder.getContext().getAuthentication().getName().
equals("anonymousUser")) {
//用户已登录
}else{
//用户未登录
}
Comments | NOTHING