yingp 7 жил өмнө
parent
commit
14553158e1

+ 2 - 2
base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/AuthFilter.java

@@ -104,8 +104,8 @@ public class AuthFilter implements GlobalFilter, Ordered {
      * @return
      */
     private boolean isIgnore(ServerHttpRequest request) {
-        String path = request.getPath().value();
-        return authConfig.getIgnores().stream().anyMatch(ignore -> ignore.equals(path));
+        return authConfig.getIgnores().stream().anyMatch(ignore ->
+                new AntPathRequestMatcher(ignore).matches(request));
     }
 
     private String getAuthHeaderToken(ServerHttpRequest request) {

+ 5 - 0
base-servers/gateway-server/src/main/resources/application.yml

@@ -104,6 +104,10 @@ spring:
         - Path=/api/commons/**
         filters:
         - RewritePath=/api/commons/(?<segment>.*), /$\{segment}
+      - id: SOCKET-SERVER
+        uri: lb:ws://SOCKET-SERVER
+        predicates:
+        - Path=/ws/**
   redis:
     host: 192.168.253.12
     port: 6379
@@ -178,3 +182,4 @@ auth:
     - /api/auth/sso/callback
     - /api/account/account/register
     - /api/auth/info
+    - /ws/**

+ 1 - 1
base-servers/socket/socket-server/src/main/resources/application.yml

@@ -40,7 +40,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
 server:
   port: 8680
   tomcat: