volta 2 роки тому
батько
коміт
d871d6df84

+ 2 - 0
launch-admin/src/main/java/com/webflux/launchadmin/config/LoginWebFiter.java

@@ -62,9 +62,11 @@ public class LoginWebFiter implements WebFilter {
             headers.add("Access-Control-Max-Age", "3600");
             headers.add("Access-Control-Allow-Credentials", "false");
 //        }
+        System.out.println(request.getMethod());
         //预检请求
         if (request.getMethod().equals(HttpMethod.OPTIONS.name())) {
             response.setStatusCode(HttpStatus.OK);
+            System.out.println("options 通过");
             return response.setComplete();
         }
 

+ 18 - 18
launch-admin/src/main/java/com/webflux/launchadmin/config/MyWebConfiguration.java

@@ -5,21 +5,21 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.web.reactive.config.CorsRegistry;
 import org.springframework.web.reactive.config.WebFluxConfigurer;
 
-@Configuration
-public class MyWebConfiguration {
-
-    //配置底层
-    @Bean
-    public WebFluxConfigurer webFluxConfigurer(){
-
-        return new WebFluxConfigurer() {
-            @Override
-            public void addCorsMappings(CorsRegistry registry) {
-                registry.addMapping("/**")
-                        .allowedHeaders("*")
-                        .allowedMethods("*")
-                        .allowedOrigins("localhost");
-            }
-        };
-    }
-}
+//@Configuration
+//public class MyWebConfiguration {
+//
+//    //配置底层
+//    @Bean
+//    public WebFluxConfigurer webFluxConfigurer(){
+//
+//        return new WebFluxConfigurer() {
+//            @Override
+//            public void addCorsMappings(CorsRegistry registry) {
+//                registry.addMapping("/**")
+//                        .allowedHeaders("*")
+//                        .allowedMethods("*")
+//                        .allowedOrigins("localhost");
+//            }
+//        };
+//    }
+//}