springSecurity详解

参考:https://www.jianshu.com/p/ac42f38baf6e

SecurityContextHolder.getContext().getAuthentication().getAuthorities() != null
                && SecurityContextHolder.getContext().getAuthentication().isAuthenticated()
                && !SecurityContextHolder.getContext().getAuthentication().getPrincipal().toString().equals("anonymousUser")

经常判断上面是否成立来判断是否是当前用户

 

posted @ 2018-09-29 14:51  十黎九夏  阅读(224)  评论(0编辑  收藏  举报