Ver Fonte

跨域问题

xusonglin há 5 anos atrás
pai
commit
5378c05530

+ 1 - 0
src/main/java/com/jkcredit/sysnews/config/CorsConfig.java

@@ -16,6 +16,7 @@ import org.springframework.web.filter.CorsFilter;
 public class CorsConfig {
     private CorsConfiguration buildConfig() {
         CorsConfiguration corsConfiguration = new CorsConfiguration();
+        corsConfiguration.setAllowCredentials(true);
         corsConfiguration.addAllowedOrigin("*"); //允许任何域名
         corsConfiguration.addAllowedHeader("*"); //允许任何头
         corsConfiguration.addAllowedMethod("*"); //允许任何方法