Переглянути джерело

产品拦截列表放到数据库,并且加载到缓存

gaodm 5 роки тому
батько
коміт
131bfdce5f

+ 1 - 1
config-server/src/main/resources/shared/gateway-service-dev.yml

@@ -183,4 +183,4 @@ server:
 
 #网关是否验证产品线接口权限
 lantone:
-  valid: true
+  gateway-valid: true

+ 1 - 1
config-server/src/main/resources/shared/gateway-service-local.yml

@@ -183,4 +183,4 @@ server:
 
 #网关是否验证产品线接口权限
 lantone:
-  valid: true
+  gateway-valid: false

+ 1 - 1
config-server/src/main/resources/shared/gateway-service-pre.yml

@@ -193,4 +193,4 @@ server:
 
 #网关是否验证产品线接口权限
 lantone:
-  valid: true
+  gateway-valid: true

+ 1 - 1
config-server/src/main/resources/shared/gateway-service-pro.yml

@@ -183,4 +183,4 @@ server:
 
 #网关是否验证产品线接口权限
 lantone:
-  valid: true
+  gateway-valid: true

+ 1 - 1
config-server/src/main/resources/shared/gateway-service-test.yml

@@ -183,4 +183,4 @@ server:
 
 #网关是否验证产品线接口权限
 lantone:
-  valid: true
+  gateway-valid: true

+ 3 - 3
gateway-service/src/main/java/com/diagbot/filter/GlobalGatewayFilter.java

@@ -55,8 +55,8 @@ public class GlobalGatewayFilter implements GlobalFilter {
     private static Boolean IS_GENERATE = false;
     private static Map<String, Long> SERVICE_FILTER = new HashMap<>();
 
-    @Value("${lantone.valid}")
-    private Boolean lantoneValid;
+    @Value("${lantone.gateway-valid}")
+    private Boolean gatewayValid;
 
     //    @Autowired
     //    DiagbotmanServiceClient diagbotmanServiceClient;
@@ -90,7 +90,7 @@ public class GlobalGatewayFilter implements GlobalFilter {
         }
 
         //网关验证产品线接口权限
-        if (lantoneValid) {
+        if (gatewayValid) {
             ServiceFilterDTO serviceFilterDTO = new ServiceFilterDTO();
             try {
                 serviceFilterDTO = serviceFilterFacade.getServiceFilter();