feat(gateway): 更新SaToken配置以添加新的免登录路径和执行器路径检查
- 添加 /qms/external/** 到免登录接口列表 - 为 /actuator/ 路径添加特殊处理逻辑 - 重新格式化 notMatch 方法中的路径配置 - 实现请求路径包含检查替代通配符匹配
This commit is contained in:
parent
de41b20598
commit
b2bc1130cd
|
|
@ -38,9 +38,17 @@ public class SaTokenConfigure {
|
|||
.setAuth(obj -> {
|
||||
// 登录校验 -- 拦截所有路由
|
||||
SaRouter.match("/**")
|
||||
.notMatch("/auth/**","/srm-receive/**", "/shipment/material/**","**/actuator/**","**/external/**"
|
||||
.notMatch("/auth/**"
|
||||
, "/srm-receive/**"
|
||||
, "/shipment/material/**"
|
||||
, "/qms/external/**"
|
||||
// MPM 免登录接口
|
||||
, "/admin/material/mpm/**", "/admin/package/mpm/**")
|
||||
, "/admin/material/mpm/**"
|
||||
, "/admin/package/mpm/**")
|
||||
.notMatch(r -> {
|
||||
String path = SaHolder.getRequest().getRequestPath();
|
||||
return path.contains("/actuator/");
|
||||
})
|
||||
.check(r -> {
|
||||
String traceId = SaHolder.getRequest().getHeader(Constant.TRACE_ID_HEADER, IdUtil.getSnowflakeNextIdStr());
|
||||
MDC.put(Constant.TRACE_ID, traceId);
|
||||
|
|
|
|||
Loading…
Reference in New Issue