Browse Source

Spring Security配置修改

macro 2 years ago
parent
commit
f5b42329e6

+ 2 - 0
mall-security/src/main/java/com/macro/mall/security/config/SecurityConfig.java

@@ -10,6 +10,7 @@ import org.springframework.http.HttpMethod;
 import org.springframework.security.authentication.AuthenticationManager;
 import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
 import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
 import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
 import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
 import org.springframework.security.config.http.SessionCreationPolicy;
@@ -25,6 +26,7 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic
  * Created by macro on 2019/11/5.
  */
 @Configuration
+@EnableWebSecurity
 public class SecurityConfig {
 
     @Autowired