配置登录安全验证接口返回JSON数据
This commit is contained in:
parent
fd756fe7b3
commit
b93aa6f844
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.idea
|
||||
*.iml
|
@ -8,7 +8,7 @@
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
@ -26,15 +26,16 @@ public class SecurityConfiguration {
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
.formLogin()
|
||||
.loginProcessingUrl("/api/auth/login")
|
||||
.successHandler(this::onAuthenticationSuccess)
|
||||
.failureHandler(this::onAuthenticationFailure)
|
||||
.loginProcessingUrl("/api/auth/login")//登录页面
|
||||
.successHandler(this::onAuthenticationSuccess)//登录成功返回
|
||||
.failureHandler(this::onAuthenticationFailure)//登录失败返回
|
||||
.and()
|
||||
.logout()
|
||||
.logoutUrl("api/auth/logout")
|
||||
.and()
|
||||
.csrf()
|
||||
.disable()
|
||||
//无权限返回
|
||||
.exceptionHandling()
|
||||
.authenticationEntryPoint(this::onAuthenticationFailure)
|
||||
.and()
|
||||
|
Loading…
Reference in New Issue
Block a user