You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
未能读取到有效 token
2024-09-13 21:13:20.002 TRACE 3771 --- [ctor-http-nio-4] o.s.c.g.f.WeightCalculatorWebFilter : Weights attr: {}
2024-09-13 21:13:20.002 TRACE 3771 --- [ctor-http-nio-4] o.s.c.g.h.p.PathRoutePredicateFactory : Pattern "[/oss/]" does not match against value "/doc.html"
2024-09-13 21:13:20.003 TRACE 3771 --- [ctor-http-nio-4] o.s.c.g.h.p.PathRoutePredicateFactory : Pattern "[/test/]" does not match against value "/doc.html"
2024-09-13 21:13:20.003 TRACE 3771 --- [ctor-http-nio-4] o.s.c.g.h.p.PathRoutePredicateFactory : Pattern "[/auth/**]" does not match against value "/doc.html"
2024-09-13 21:13:20.003 TRACE 3771 --- [ctor-http-nio-4] o.s.c.g.h.RoutePredicateHandlerMapping : No RouteDefinition found for [Exchange: GET http://localhost:6001/doc.html]
2024-09-13 21:13:20.003 DEBUG 3771 --- [ctor-http-nio-4] o.s.w.r.handler.SimpleUrlHandlerMapping : [1d44b4bb-23] Mapped to ResourceWebHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/]]
希望结果:
怎么配置了这个排除的路径,还是显示没有token,被拦截了呢
< 备注:如果复现步骤比较复杂,请将 demo 上传到 gitee 并留下地址 >
The text was updated successfully, but these errors were encountered:
PolarishT
changed the title
使用Satoken
使用Satoken + SpringCloudGateWay + swagger 异常
Sep 13, 2024
PolarishT
changed the title
使用Satoken + SpringCloudGateWay + swagger 异常
使用Satoken + SpringCloudGateWay + knife4j 异常
Sep 13, 2024
使用版本:
SpringBoot 2.7.6
com.github.xiaoymin knife4j-gateway-spring-boot-starter 4.4.0 cn.dev33 sa-token-reactor-spring-boot-starter 1.38.0SpringCloudAlibaba 2021.0.5.0
SpringCloud 2021.0.5
复现代码:
package com.raso.cloud.nav.auth.config.route;
import cn.dev33.satoken.context.SaHolder;
import cn.dev33.satoken.reactor.context.SaReactorSyncHolder;
import cn.dev33.satoken.reactor.filter.SaReactorFilter;
import cn.dev33.satoken.router.SaHttpMethod;
import cn.dev33.satoken.router.SaRouter;
import cn.dev33.satoken.stp.StpUtil;
import com.alibaba.nacos.shaded.com.google.gson.Gson;
import com.raso.cloud.nav.auth.util.ResponseUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.web.server.ServerWebExchange;
import javax.annotation.Resource;
import java.util.Map;
import java.util.stream.Collectors;
/**
[Sa-Token 权限认证] 配置类
@author 北极星
*/
@configuration
public class SaTokenConfig {
@resource
WhiteRouteList whiteRouteList;
@resource
PermissionRouteList permissionRouteList;
@bean
public SaReactorFilter getSaReactorFilter() {
// .setExcludeList(whiteRouteList.getRoutes())
// SaRouter.match("/**", r -> StpUtil.checkRole("normal_user"));
}
application.yml
knife4j:
gateway:
enabled: true
strategy: discover
discover:
enabled: true
version: swagger2
报错信息:
未能读取到有效 token
2024-09-13 21:13:20.002 TRACE 3771 --- [ctor-http-nio-4] o.s.c.g.f.WeightCalculatorWebFilter : Weights attr: {}
2024-09-13 21:13:20.002 TRACE 3771 --- [ctor-http-nio-4] o.s.c.g.h.p.PathRoutePredicateFactory : Pattern "[/oss/]" does not match against value "/doc.html"
2024-09-13 21:13:20.003 TRACE 3771 --- [ctor-http-nio-4] o.s.c.g.h.p.PathRoutePredicateFactory : Pattern "[/test/]" does not match against value "/doc.html"
2024-09-13 21:13:20.003 TRACE 3771 --- [ctor-http-nio-4] o.s.c.g.h.p.PathRoutePredicateFactory : Pattern "[/auth/**]" does not match against value "/doc.html"
2024-09-13 21:13:20.003 TRACE 3771 --- [ctor-http-nio-4] o.s.c.g.h.RoutePredicateHandlerMapping : No RouteDefinition found for [Exchange: GET http://localhost:6001/doc.html]
2024-09-13 21:13:20.003 DEBUG 3771 --- [ctor-http-nio-4] o.s.w.r.handler.SimpleUrlHandlerMapping : [1d44b4bb-23] Mapped to ResourceWebHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/]]
希望结果:
怎么配置了这个排除的路径,还是显示没有token,被拦截了呢
< 备注:如果复现步骤比较复杂,请将 demo 上传到 gitee 并留下地址 >
The text was updated successfully, but these errors were encountered: