Browse Source

用户、课堂、直播模块启用EurekaClient

拦截器allowedOrigins换为allowedOriginPatterns
tags/正式3.2.0
雍文秀 2 years ago
parent
commit
3f7851990f

+ 1
- 1
sapi/src/main/java/com/xhkjedu/sapi/interceptors/WebMvcConfg.java View File

@@ -45,7 +45,7 @@ public class WebMvcConfg implements WebMvcConfigurer {
45 45
     @Override
46 46
     public void addCorsMappings(CorsRegistry registry){
47 47
         registry.addMapping("/**")
48
-                .allowedOrigins("*")
48
+                .allowedOriginPatterns("*")
49 49
                 .allowCredentials(true)
50 50
                 .allowedMethods("GET","POST")
51 51
                 .maxAge(3600);

+ 4
- 4
sclass/pom.xml View File

@@ -26,10 +26,10 @@
26 26
         <!--    <groupId>org.springframework.cloud</groupId>-->
27 27
         <!--    <artifactId>spring-cloud-starter-config</artifactId>-->
28 28
         <!--</dependency>-->
29
-        <!--<dependency>-->
30
-        <!--    <groupId>org.springframework.cloud</groupId>-->
31
-        <!--    <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>-->
32
-        <!--</dependency>-->
29
+        <dependency>
30
+            <groupId>org.springframework.cloud</groupId>
31
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
32
+        </dependency>
33 33
 
34 34
         <dependency>
35 35
             <groupId>mysql</groupId>

+ 2
- 0
sclass/src/main/java/com/xhkjedu/sclass/SclassApplication.java View File

@@ -2,10 +2,12 @@ package com.xhkjedu.sclass;
2 2
 
3 3
 import org.springframework.boot.SpringApplication;
4 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
5 6
 import tk.mybatis.spring.annotation.MapperScan;
6 7
 
7 8
 @SpringBootApplication
8 9
 @MapperScan("com.xhkjedu.sclass.mapper")
10
+@EnableEurekaClient
9 11
 public class SclassApplication {
10 12
 
11 13
     public static void main(String[] args) {

+ 1
- 1
sclass/src/main/java/com/xhkjedu/sclass/interceptors/WebMvcConfg.java View File

@@ -45,7 +45,7 @@ public class WebMvcConfg implements WebMvcConfigurer {
45 45
     @Override
46 46
     public void addCorsMappings(CorsRegistry registry){
47 47
         registry.addMapping("/**")
48
-                .allowedOrigins("*")
48
+                .allowedOriginPatterns("*")
49 49
                 .allowCredentials(true)
50 50
                 .allowedMethods("GET","POST")
51 51
                 .maxAge(3600);

+ 4
- 4
slive/pom.xml View File

@@ -26,10 +26,10 @@
26 26
         <!--    <groupId>org.springframework.cloud</groupId>-->
27 27
         <!--    <artifactId>spring-cloud-starter-config</artifactId>-->
28 28
         <!--</dependency>-->
29
-        <!--<dependency>-->
30
-        <!--    <groupId>org.springframework.cloud</groupId>-->
31
-        <!--    <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>-->
32
-        <!--</dependency>-->
29
+        <dependency>
30
+            <groupId>org.springframework.cloud</groupId>
31
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
32
+        </dependency>
33 33
 
34 34
         <dependency>
35 35
             <groupId>mysql</groupId>

+ 2
- 0
slive/src/main/java/com/xhkjedu/slive/SliveApplication.java View File

@@ -2,10 +2,12 @@ package com.xhkjedu.slive;
2 2
 
3 3
 import org.springframework.boot.SpringApplication;
4 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
5 6
 import tk.mybatis.spring.annotation.MapperScan;
6 7
 
7 8
 @SpringBootApplication
8 9
 @MapperScan("com.xhkjedu.slive.mapper")
10
+@EnableEurekaClient
9 11
 public class SliveApplication {
10 12
 
11 13
     public static void main(String[] args) {

+ 1
- 1
slive/src/main/java/com/xhkjedu/slive/interceptors/WebMvcConfg.java View File

@@ -45,7 +45,7 @@ public class WebMvcConfg implements WebMvcConfigurer {
45 45
     @Override
46 46
     public void addCorsMappings(CorsRegistry registry){
47 47
         registry.addMapping("/**")
48
-                .allowedOrigins("*")
48
+                .allowedOriginPatterns("*")
49 49
                 .allowCredentials(true)
50 50
                 .allowedMethods("GET","POST")
51 51
                 .maxAge(3600);

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/interceptors/WebMvcConfg.java View File

@@ -45,7 +45,7 @@ public class WebMvcConfg implements WebMvcConfigurer {
45 45
     @Override
46 46
     public void addCorsMappings(CorsRegistry registry){
47 47
         registry.addMapping("/**")
48
-                .allowedOrigins("*")
48
+                .allowedOriginPatterns("*")
49 49
                 .allowCredentials(true)
50 50
                 .allowedMethods("GET","POST")
51 51
                 .maxAge(3600);

+ 4
- 7
suser/pom.xml View File

@@ -26,7 +26,10 @@
26 26
         <!--    <groupId>org.springframework.cloud</groupId>-->
27 27
         <!--    <artifactId>spring-cloud-starter-config</artifactId>-->
28 28
         <!--</dependency>-->
29
-
29
+        <dependency>
30
+            <groupId>org.springframework.cloud</groupId>
31
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
32
+        </dependency>
30 33
         <dependency>
31 34
             <groupId>mysql</groupId>
32 35
             <artifactId>mysql-connector-java</artifactId>
@@ -41,12 +44,6 @@
41 44
             <artifactId>spring-boot-starter-test</artifactId>
42 45
             <scope>test</scope>
43 46
         </dependency>
44
-        <!--mybatis通用mapper依赖-->
45
-        <!--<dependency>-->
46
-        <!--    <groupId>tk.mybatis</groupId>-->
47
-        <!--    <artifactId>mapper-spring-boot-starter</artifactId>-->
48
-        <!--    <version>2.1.5</version>-->
49
-        <!--</dependency>-->
50 47
         <dependency>
51 48
             <groupId>com.xhkjedu</groupId>
52 49
             <artifactId>scommons</artifactId>

+ 2
- 0
suser/src/main/java/com/xhkjedu/suser/SuserApplication.java View File

@@ -2,10 +2,12 @@ package com.xhkjedu.suser;
2 2
 
3 3
 import org.springframework.boot.SpringApplication;
4 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
5 6
 import tk.mybatis.spring.annotation.MapperScan;
6 7
 
7 8
 @SpringBootApplication
8 9
 @MapperScan("com.xhkjedu.suser.mapper")
10
+@EnableEurekaClient
9 11
 public class SuserApplication {
10 12
 
11 13
     public static void main(String[] args) {

+ 1
- 1
suser/src/main/java/com/xhkjedu/suser/interceptors/WebMvcConfg.java View File

@@ -45,7 +45,7 @@ public class WebMvcConfg implements WebMvcConfigurer {
45 45
     @Override
46 46
     public void addCorsMappings(CorsRegistry registry){
47 47
         registry.addMapping("/**")
48
-                .allowedOrigins("*")
48
+                .allowedOriginPatterns("*")
49 49
                 .allowCredentials(true)
50 50
                 .allowedMethods("GET","POST")
51 51
                 .maxAge(3600);

Loading…
Cancel
Save