feat:网关过滤

This commit is contained in:
xiang
2026-03-22 19:05:27 +08:00
parent 78a26b2ed2
commit 6951a2513f
3 changed files with 27 additions and 2 deletions

View File

@@ -31,12 +31,18 @@ spring:
- Path=/api-common/**
filters:
- StripPrefix=1
- id: xservice-stock-center
uri: lb://xservice-stock-center
predicates:
- Path=/api-stock/**
filters:
- StripPrefix=1
redis:
host: r-bp1wt59a6nfyt4e3ltpd.redis.rds.aliyuncs.com
port: 6379
password: Xiang0000 # 如果无密码可以省略
database: 0
database: 10
timeout: 5000
lettuce:
pool:

View File

@@ -10,7 +10,7 @@ spring:
nacos:
discovery:
server-addr: general.xiangtech.xyz:8848
namespace: e4a9b94d-637e-4faf-8521-6ffc090a8c03
namespace: 6f603892-e9f7-4ca4-acbc-538fa09ebec0
group: DEFAULT_GROUP
username: nacos
password: nacos
@@ -25,6 +25,24 @@ spring:
- Path=/api-auth/**
filters:
- 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:
host: r-bp1wt59a6nfyt4e3ltpd.redis.rds.aliyuncs.com

View File

@@ -35,6 +35,7 @@ public class AuthGlobalFilter implements GlobalFilter, Ordered {
log.debug("跳过 Token 校验: {}", path);
return chain.filter(exchange);
}
// todo open开放接口如何处理
// 获取 Header 中的 Authorization
String token = request.getHeaders().getFirst("Authorization");