提交 52531b98 编写于 作者: zlt2000's avatar zlt2000

修复redis类型的token时,登出时的清理问题

上级 f3a4c394
......@@ -132,4 +132,8 @@ public interface SecurityConstants {
* 手机登录URL
*/
String MOBILE_TOKEN_URL = "/oauth/mobile/token";
/**
* 登出URL
*/
String LOGOUT_URL = "/oauth/remove/token";
}
......@@ -89,6 +89,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.failureHandler(authenticationFailureHandler)
.and()
.logout()
.logoutUrl(SecurityConstants.LOGOUT_URL)
.logoutSuccessUrl(SecurityConstants.LOGIN_PAGE)
.logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler())
.addLogoutHandler(oauthLogoutHandler)
......
......@@ -67,17 +67,6 @@ public class OAuth2Controller {
@Resource
private UserService userService;
@GetMapping("/oauth/test")
public SysUser testNacos() {
return userService.selectByUsername("admin");
}
@GetMapping("/oauth/test2")
public String testNacos2() throws InterruptedException {
Thread.sleep(5000);
return "success";
}
@ApiOperation(value = "用户名密码获取token")
@PostMapping(SecurityConstants.PASSWORD_LOGIN_PRO_URL)
public void getUserTokenInfo(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册