master
parent
5082df5be4
commit
470b210f65
|
|
@ -0,0 +1,14 @@
|
|||
package com.boot.security.server.config;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.view.RedirectView;
|
||||
|
||||
@Controller
|
||||
public class LoginPageConfig {
|
||||
|
||||
@RequestMapping("/")
|
||||
public RedirectView loginPage() {
|
||||
return new RedirectView("/login.html");
|
||||
}
|
||||
}
|
||||
|
|
@ -55,8 +55,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
|
||||
|
||||
http.authorizeRequests()
|
||||
.antMatchers(HttpMethod.GET, "/*.html", "/favicon.ico", "/css/**", "/js/**", "/fonts/**", "/layui/**",
|
||||
"/img/**", "/v2/api-docs/**", "/swagger-resources/**", "/webjars/**", "/pages/**")
|
||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/favicon.ico", "/css/**", "/js/**", "/fonts/**",
|
||||
"/layui/**", "/img/**", "/v2/api-docs/**", "/swagger-resources/**", "/webjars/**", "/pages/**")
|
||||
.permitAll().anyRequest().authenticated();
|
||||
http.formLogin().loginPage("/login.html").loginProcessingUrl("/login")
|
||||
.successHandler(authenticationSuccessHandler).failureHandler(authenticationFailureHandler).and()
|
||||
|
|
|
|||
Loading…
Reference in New Issue