feat:网关过滤
This commit is contained in:
@@ -31,12 +31,18 @@ spring:
|
|||||||
- Path=/api-common/**
|
- Path=/api-common/**
|
||||||
filters:
|
filters:
|
||||||
- StripPrefix=1
|
- StripPrefix=1
|
||||||
|
- id: xservice-stock-center
|
||||||
|
uri: lb://xservice-stock-center
|
||||||
|
predicates:
|
||||||
|
- Path=/api-stock/**
|
||||||
|
filters:
|
||||||
|
- StripPrefix=1
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
host: r-bp1wt59a6nfyt4e3ltpd.redis.rds.aliyuncs.com
|
host: r-bp1wt59a6nfyt4e3ltpd.redis.rds.aliyuncs.com
|
||||||
port: 6379
|
port: 6379
|
||||||
password: Xiang0000 # 如果无密码可以省略
|
password: Xiang0000 # 如果无密码可以省略
|
||||||
database: 0
|
database: 10
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: general.xiangtech.xyz:8848
|
server-addr: general.xiangtech.xyz:8848
|
||||||
namespace: e4a9b94d-637e-4faf-8521-6ffc090a8c03
|
namespace: 6f603892-e9f7-4ca4-acbc-538fa09ebec0
|
||||||
group: DEFAULT_GROUP
|
group: DEFAULT_GROUP
|
||||||
username: nacos
|
username: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
@@ -25,6 +25,24 @@ spring:
|
|||||||
- Path=/api-auth/**
|
- Path=/api-auth/**
|
||||||
filters:
|
filters:
|
||||||
- StripPrefix=1
|
- StripPrefix=1
|
||||||
|
- id: xservice-common-center
|
||||||
|
uri: lb://xservice-common-center
|
||||||
|
predicates:
|
||||||
|
- Path=/api-common/**
|
||||||
|
filters:
|
||||||
|
- StripPrefix=1
|
||||||
|
- id: xservice-stock-center
|
||||||
|
uri: lb://xservice-stock-center
|
||||||
|
predicates:
|
||||||
|
- Path=/api-stock/**
|
||||||
|
filters:
|
||||||
|
- StripPrefix=1
|
||||||
|
- id: xservice-quartz-admin
|
||||||
|
uri: lb://xservice-quartz-admin
|
||||||
|
predicates:
|
||||||
|
- Path=/api-quartz/**
|
||||||
|
filters:
|
||||||
|
- StripPrefix=1
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
host: r-bp1wt59a6nfyt4e3ltpd.redis.rds.aliyuncs.com
|
host: r-bp1wt59a6nfyt4e3ltpd.redis.rds.aliyuncs.com
|
||||||
@@ -35,6 +35,7 @@ public class AuthGlobalFilter implements GlobalFilter, Ordered {
|
|||||||
log.debug("跳过 Token 校验: {}", path);
|
log.debug("跳过 Token 校验: {}", path);
|
||||||
return chain.filter(exchange);
|
return chain.filter(exchange);
|
||||||
}
|
}
|
||||||
|
// todo open开放接口如何处理
|
||||||
|
|
||||||
// 获取 Header 中的 Authorization
|
// 获取 Header 中的 Authorization
|
||||||
String token = request.getHeaders().getFirst("Authorization");
|
String token = request.getHeaders().getFirst("Authorization");
|
||||||
|
|||||||
Reference in New Issue
Block a user