Open mzywtj opened 6 years ago
我发现注销有时候可以注销,有时候不能注销 @Controller public class UserController { @RequestMapping(value = "/user", produces = "application/json") @ResponseBody public Principal user(Principal user){ return user; }
@Autowired @Qualifier("consumerTokenServices") ConsumerTokenServices consumerTokenServices; @RequestMapping(value = "/loginOut") @ResponseBody public String revokeToken(String access_token) { try { if (consumerTokenServices.revokeToken(access_token)) { return "注销成功"; } else { return "注销失败"; } } catch (Exception e) { e.printStackTrace(); return "异常"; } }
} 发现这样写就可以实现注销了,当然写个 .antMatchers("/loginOut").permitAll()
我发现注销有时候可以注销,有时候不能注销 @Controller public class UserController { @RequestMapping(value = "/user", produces = "application/json") @ResponseBody public Principal user(Principal user){ return user; }
} 发现这样写就可以实现注销了,当然写个 .antMatchers("/loginOut").permitAll()