Discuss / Java / Interceptor拦截指定路径

Interceptor拦截指定路径

Topic source

Loading...

#1 Created at ... [Delete] [Delete and Lock User]

注册拦截器的时候设置路径。廖大那种就是统一把所有拦截器都注册了。你想单独管理就要单独配置。鱼与熊掌不可兼得🤷‍♂️🤷‍♂️

registry.addInterceptor(new AuthInterceptor()).addPathPatterns("/user");

百度到的大多是通过xml配置方式,都差不多


  • 1

Reply