minjay26
敬畏每一行代码
@RequestMapping("/login")
  public String login(){
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    if(auth instanceof AnonymousAuthenticationToken){
      return "login";
    }else{
      return "home";
    }
}

 

posted on 2016-07-14 13:55  minjay26  阅读(3780)  评论(0编辑  收藏  举报