mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-04 04:45:28 +08:00
v3.9.0 里程碑版本发布
This commit is contained in:
@ -34,12 +34,11 @@ public class GlobalAccessTokenFilter implements GlobalFilter, Ordered {
|
||||
String scheme = exchange.getRequest().getURI().getScheme();
|
||||
String host = exchange.getRequest().getURI().getHost();
|
||||
int port = exchange.getRequest().getURI().getPort();
|
||||
//update-begin---author:chenrui ---date:20240603 for:地址中没有带端口(http/https默认)时port是-1------------
|
||||
// 代码逻辑说明: 地址中没有带端口(http/https默认)时port是-1------------
|
||||
String basePath = scheme + "://" + host;
|
||||
if (port != -1) {
|
||||
basePath += ":" + port;
|
||||
}
|
||||
//update-end---author:chenrui ---date:20240603 for:地址中没有带端口(http/https默认)时port是-1------------
|
||||
// 1. 重写StripPrefix(获取真实的URL)
|
||||
addOriginalRequestUrl(exchange, exchange.getRequest().getURI());
|
||||
String rawPath = exchange.getRequest().getURI().getRawPath();
|
||||
|
||||
@ -92,12 +92,11 @@ public class MySwaggerResourceProvider implements SwaggerResourcesProvider {
|
||||
routeLocator.getRoutes().filter(route -> route.getUri().getHost() != null)
|
||||
.filter(route -> !self.equals(route.getUri().getHost()))
|
||||
.subscribe(route ->{
|
||||
//update-begin---author:zyf ---date:20220413 for:过滤掉无效路由,避免接口文档报错无法打开
|
||||
// 代码逻辑说明: 过滤掉无效路由,避免接口文档报错无法打开
|
||||
boolean hasRoute=checkRoute(route.getId());
|
||||
if(hasRoute){
|
||||
routeHosts.add(route.getUri().getHost());
|
||||
}
|
||||
//update-end---author:zyf ---date:20220413 for:过滤掉无效路由,避免接口文档报错无法打开
|
||||
});
|
||||
|
||||
// 记录已经添加过的server,存在同一个应用注册了多个服务在nacos上
|
||||
|
||||
@ -205,7 +205,7 @@ public class DynamicRouteLoader implements ApplicationEventPublisherAware {
|
||||
}
|
||||
Object predicates = obj.get("predicates");
|
||||
if (predicates != null) {
|
||||
//update-begin-author:liusq---date:2023-10-15--for: [issues/5331]网关路由配置问题
|
||||
// 代码逻辑说明: [issues/5331]网关路由配置问题
|
||||
List<PredicatesVo> list = JSON.parseArray(predicates.toString(), PredicatesVo.class);
|
||||
//获取合并后的Predicates,防止配置多个path导致路径失效的问题
|
||||
Map<String, List<String>> groupedPredicates = new HashMap<>();
|
||||
@ -221,12 +221,11 @@ public class DynamicRouteLoader implements ApplicationEventPublisherAware {
|
||||
List<String> args = entry.getValue();
|
||||
list.add(new PredicatesVo(name, args));
|
||||
}
|
||||
//update-end-author:liusq---date:2023-10-15--for:[issues/5331]网关路由配置问题
|
||||
List<PredicateDefinition> predicateDefinitionList = new ArrayList<>();
|
||||
for (Object map : list) {
|
||||
JSONObject json = JSON.parseObject(JSON.toJSONString(map));
|
||||
PredicateDefinition predicateDefinition = new PredicateDefinition();
|
||||
//update-begin-author:zyf date:20220419 for:【VUEN-762】路由条件添加异常问题,原因是部分路由条件参数需要设置固定key
|
||||
// 代码逻辑说明: 【VUEN-762】路由条件添加异常问题,原因是部分路由条件参数需要设置固定key
|
||||
String name=json.getString("name");
|
||||
predicateDefinition.setName(name);
|
||||
//路由条件是否拼接Key
|
||||
@ -246,7 +245,6 @@ public class DynamicRouteLoader implements ApplicationEventPublisherAware {
|
||||
}
|
||||
}
|
||||
}
|
||||
//update-end-author:zyf date:20220419 for:【VUEN-762】路由条件添加异常问题,原因是部分路由条件参数需要设置固定key
|
||||
predicateDefinitionList.add(predicateDefinition);
|
||||
}
|
||||
route.setPredicates(predicateDefinitionList);
|
||||
|
||||
Reference in New Issue
Block a user