修复redis类型的token时,登出时的清理问题
This commit is contained in:
+4
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user