We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
可以通过 //admin路径开头跳过登录拦截器,访问后台接口,接口能够正常访问。 例如: post http://127.0.0.1//admin/v1/blogConfig/add 参数 configField=111 configName=111 configValue=111 无需登录即可访问接口
The text was updated successfully, but these errors were encountered:
if (uri.startsWith("/admin") && null == request.getSession().getAttribute("loginUserId")) 去掉这个 uri.startsWith("/admin")即可
Sorry, something went wrong.
收到,但我觉得这样解决更好,如下: Pattern pattern = Pattern.compile("\\b/admin\\b"); pattern.matcher(uri).find() 因为这个拦截器只针对后台,直接去掉uri.startsWith(“ / admin”)之后就变成拦截全部了
Pattern pattern = Pattern.compile("\\b/admin\\b");
pattern.matcher(uri).find()
uri.startsWith(“ / admin”)
在配置类中配置了拦截路径,//admin/xxx也不会放行 // 添加一个拦截器,拦截以/admin为前缀的url路径 后台管理登录拦截 registry.addInterceptor(adminLoginInterceptor) .addPathPatterns("/admin/") .excludePathPatterns("/admin/v1/login") .excludePathPatterns("/admin/v1/reload") .excludePathPatterns("/admin/dist/") .excludePathPatterns("/admin/plugins/") .excludePathPatterns("/X-admin/");
Linn-cn
No branches or pull requests
可以通过 //admin路径开头跳过登录拦截器,访问后台接口,接口能够正常访问。
例如:
post http://127.0.0.1//admin/v1/blogConfig/add
参数
configField=111
configName=111
configValue=111
无需登录即可访问接口
The text was updated successfully, but these errors were encountered: