Browse Source

删除跨域冗余代码

tags/正式3.8.0
王宁 1 year ago
parent
commit
bc99c4f741

+ 0
- 34
sapi/src/main/java/com/xhkjedu/sapi/config/CorsConfig.java View File

@@ -1,34 +0,0 @@
1
-package com.xhkjedu.sapi.config;
2
-
3
-import org.springframework.context.annotation.Bean;
4
-import org.springframework.context.annotation.Configuration;
5
-import org.springframework.web.cors.CorsConfiguration;
6
-import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
7
-import org.springframework.web.filter.CorsFilter;
8
-
9
-/**
10
- * @ClassName CorsConfig
11
- * Description 请求跨域支持
12
- * Author WN
13
- * Date 2020/6/5 16:29
14
- **/
15
-@Configuration
16
-public class CorsConfig {
17
-    private CorsConfiguration corsConfiguration() {
18
-        CorsConfiguration corsConfiguration = new CorsConfiguration();
19
-        // 1允许任何域名使用
20
-        corsConfiguration.addAllowedOrigin("*");
21
-        // 2允许任何头
22
-        corsConfiguration.addAllowedHeader("*");
23
-        // 3允许任何方法(post、get等)
24
-        corsConfiguration.addAllowedMethod("*");
25
-        return corsConfiguration;
26
-    }
27
-
28
-    @Bean
29
-    public CorsFilter corsFilter() {
30
-        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
31
-        source.registerCorsConfiguration("/**", corsConfiguration());
32
-        return new CorsFilter(source);
33
-    }
34
-}

+ 0
- 34
sexam/src/main/java/com/xhkjedu/sexam/config/CorsConfig.java View File

@@ -1,34 +0,0 @@
1
-package com.xhkjedu.sexam.config;
2
-
3
-import org.springframework.context.annotation.Bean;
4
-import org.springframework.context.annotation.Configuration;
5
-import org.springframework.web.cors.CorsConfiguration;
6
-import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
7
-import org.springframework.web.filter.CorsFilter;
8
-
9
-/**
10
- * @ClassName CorsConfig
11
- * Description 请求跨域支持
12
- * Author WN
13
- * Date 2020/6/5 16:29
14
- **/
15
-@Configuration
16
-public class CorsConfig {
17
-    private CorsConfiguration corsConfiguration() {
18
-        CorsConfiguration corsConfiguration = new CorsConfiguration();
19
-        // 1允许任何域名使用
20
-        corsConfiguration.addAllowedOrigin("*");
21
-        // 2允许任何头
22
-        corsConfiguration.addAllowedHeader("*");
23
-        // 3允许任何方法(post、get等)
24
-        corsConfiguration.addAllowedMethod("*");
25
-        return corsConfiguration;
26
-    }
27
-
28
-    @Bean
29
-    public CorsFilter corsFilter() {
30
-        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
31
-        source.registerCorsConfiguration("/**", corsConfiguration());
32
-        return new CorsFilter(source);
33
-    }
34
-}

+ 0
- 34
sstudy/src/main/java/com/xhkjedu/sstudy/config/CorsConfig.java View File

@@ -1,34 +0,0 @@
1
-package com.xhkjedu.sstudy.config;
2
-
3
-import org.springframework.context.annotation.Bean;
4
-import org.springframework.context.annotation.Configuration;
5
-import org.springframework.web.cors.CorsConfiguration;
6
-import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
7
-import org.springframework.web.filter.CorsFilter;
8
-
9
-/**
10
- * @ClassName CorsConfig
11
- * Description 请求跨域支持
12
- * Author WN
13
- * Date 2020/6/5 16:29
14
- **/
15
-@Configuration
16
-public class CorsConfig {
17
-    private CorsConfiguration corsConfiguration() {
18
-        CorsConfiguration corsConfiguration = new CorsConfiguration();
19
-        // 1允许任何域名使用
20
-        corsConfiguration.addAllowedOrigin("*");
21
-        // 2允许任何头
22
-        corsConfiguration.addAllowedHeader("*");
23
-        // 3允许任何方法(post、get等)
24
-        corsConfiguration.addAllowedMethod("*");
25
-        return corsConfiguration;
26
-    }
27
-
28
-    @Bean
29
-    public CorsFilter corsFilter() {
30
-        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
31
-        source.registerCorsConfiguration("/**", corsConfiguration());
32
-        return new CorsFilter(source);
33
-    }
34
-}

+ 0
- 34
suser/src/main/java/com/xhkjedu/suser/config/CorsConfig.java View File

@@ -1,34 +0,0 @@
1
-package com.xhkjedu.suser.config;
2
-
3
-import org.springframework.context.annotation.Bean;
4
-import org.springframework.context.annotation.Configuration;
5
-import org.springframework.web.cors.CorsConfiguration;
6
-import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
7
-import org.springframework.web.filter.CorsFilter;
8
-
9
-/**
10
- * @ClassName CorsConfig
11
- * Description 请求跨域支持
12
- * Author WN
13
- * Date 2020/6/5 16:29
14
- **/
15
-@Configuration
16
-public class CorsConfig {
17
-    private CorsConfiguration corsConfiguration() {
18
-        CorsConfiguration corsConfiguration = new CorsConfiguration();
19
-        // 1允许任何域名使用
20
-        corsConfiguration.addAllowedOrigin("*");
21
-        // 2允许任何头
22
-        corsConfiguration.addAllowedHeader("*");
23
-        // 3允许任何方法(post、get等)
24
-        corsConfiguration.addAllowedMethod("*");
25
-        return corsConfiguration;
26
-    }
27
-
28
-    @Bean
29
-    public CorsFilter corsFilter() {
30
-        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
31
-        source.registerCorsConfiguration("/**", corsConfiguration());
32
-        return new CorsFilter(source);
33
-    }
34
-}

Loading…
Cancel
Save