1
0
ddch@smail.nju.edu.cn 5 лет назад
Родитель
Сommit
b1352a6963

+ 3 - 9
web/src/main/java/cn/seecoder/web/infrastructure/config/WebSecurityConfig.java

@@ -25,14 +25,11 @@ import cn.seecoder.web.infrastructure.security.WebSecurityConstants;
 @Configuration
 @EnableWebSecurity
 @EnableGlobalMethodSecurity(prePostEnabled = true)  //  启用方法级别的权限认证
-@DependsOn("userServiceImpl")
+//@DependsOn("userServiceImpl")
 public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
 
-
     private final JwtAuthenticationTokenFilter filter;
 
-
-
     @Autowired
     public WebSecurityConfig(JwtAuthenticationTokenFilter filter) {
         super();
@@ -59,9 +56,6 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 //其他所有接口都要在登陆认证状态下请求
                 .anyRequest().authenticated();
 
-
-
-
         //开启跨域
         http.cors();
 
@@ -75,14 +69,14 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
 
     @Bean
     public AuthenticationManager authenticationManager() throws Exception {
-        return super.authenticationManagerBean() ;
+        return super.authenticationManagerBean();
     }
 
     /**
      * 本地测试时的跨域设置
      */
     @Bean
-    CorsConfigurationSource corsConfigurationSource(){
+    CorsConfigurationSource corsConfigurationSource() {
         return httpServletRequest -> {
             CorsConfiguration cfg = new CorsConfiguration();
             cfg.addAllowedHeader("*");