在交流群里一个老生常谈的问题,集成swagger后访问报错,无token,放行路径如下
//放行路径
private static final String[] EXCLUDE_PATH_PATTERNS = {
// Swagger
"**/swagger-ui.html",
"/swagger-resources/**",
"/webjars/**",
"/v2/**",
"/swagger-ui.html/**",
"/doc.html/**",
"/error",
"/favicon.ico",
"sso/auth",
"/csrf"
}
当然 后台还是一样有异常输出 然后在跟踪后发现 最后要放行的路径是 / 这个就算了
2022-02-11 17:43:40.016 INFO 928 --- [ scheduling-1] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
/
2022-02-11 17:43:56.382 ERROR 928 --- [nio-5001-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is cn.dev33.satoken.exception.NotLoginException: 未提供Token] with root cause
cn.dev33.satoken.exception.NotLoginException: 未提供Token
at cn.dev33.satoken.exception.NotLoginException.newInstance(NotLoginException.java:137)
at cn.dev33.satoken.exception.NotLoginException.newInstance(NotLoginException.java:104)
at cn.dev33.satoken.stp.StpLogic.getLoginId(StpLogic.java:571)
at cn.dev33.satoken.stp.StpLogic.checkLogin(StpLogic.java:556)
at com.ge.remote.modules.system.util.StpUserUtil.checkLogin(StpUserUtil.java:332)
at com.ge.remote.config.WebMvcConfigurer.lambda$null$1(WebMvcConfigurer.java:120)