Browse Source

add 验证码

tags/V2.2.0
chenjiandong 2 years ago
parent
commit
a0006963aa
2 changed files with 9 additions and 7 deletions
  1. +2
    -1
      tuoheng_oidc_server/src/main/java/com/tuoheng/config/SecurityConfig.java
  2. +7
    -6
      tuoheng_oidc_server/src/main/java/com/tuoheng/controller/Oauth2Controller.java

+ 2
- 1
tuoheng_oidc_server/src/main/java/com/tuoheng/config/SecurityConfig.java View File

@@ -100,7 +100,8 @@ public class SecurityConfig {
form.loginPage("/toLogin")
.loginProcessingUrl("/login")
)
.logout();
.logout()
.logoutSuccessUrl("/toLogout");

return http.build();
}

+ 7
- 6
tuoheng_oidc_server/src/main/java/com/tuoheng/controller/Oauth2Controller.java View File

@@ -45,12 +45,13 @@ public class Oauth2Controller {
@GetMapping("/toLogout")
public void exit(HttpServletRequest request, HttpServletResponse response) {
new SecurityContextLogoutHandler().logout(request, null, null);
// try {
// System.out.println(request.getHeader("referer"));
// response.sendRedirect(request.getHeader("referer"));
// } catch (IOException e) {
// e.printStackTrace();
// }
try {
System.out.println(request.getHeader("referer"));
//response.sendRedirect(request.getHeader("referer"));
response.sendRedirect(request.getHeader("referer"));
} catch (IOException e) {
e.printStackTrace();
}
}

}

Loading…
Cancel
Save