Ver Fonte

bbbbbbbbbb

weijin há 4 anos atrás
pai
commit
3b87cdaf2e

+ 5 - 0
seecoder-bok-server/src/main/java/cn/seecoder/seecoderbokserver/config/webSecurityConfig.java

@@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.http.HttpMethod;
 import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
 import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.builders.WebSecurity;
 import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
 import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
 import org.springframework.security.config.http.SessionCreationPolicy;
@@ -36,4 +37,8 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter {
         httpSecurity.headers().cacheControl();
     }
 
+    @Override
+    public void configure(WebSecurity web) throws Exception{
+        web.ignoring().antMatchers( HttpMethod.OPTIONS, "/**" );
+    }
 }