Commit bebf7cc0 by “zcwang”

add: 拦截器测试

parent 10d6085e
Pipeline #43478 passed with stages
in 1 minute 28 seconds
...@@ -15,6 +15,9 @@ public class WebMvcConfig implements WebMvcConfigurer { ...@@ -15,6 +15,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
@Autowired @Autowired
private AdminUserLoginInterceptor userLoginInterceptor; private AdminUserLoginInterceptor userLoginInterceptor;
@Autowired
private UserInterceptor userInterceptor;
/** /**
* 拦截器配置 * 拦截器配置
* *
...@@ -24,6 +27,8 @@ public class WebMvcConfig implements WebMvcConfigurer { ...@@ -24,6 +27,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(userLoginInterceptor).addPathPatterns("/**").excludePathPatterns("/i/health") registry.addInterceptor(userLoginInterceptor).addPathPatterns("/**").excludePathPatterns("/i/health")
.excludePathPatterns("/change/flow/getOperator", "/test/createToDo","/test/progressTodo","/test/submit"); .excludePathPatterns("/change/flow/getOperator", "/test/createToDo","/test/progressTodo","/test/submit");
registry.addInterceptor(userInterceptor).addPathPatterns("/**").excludePathPatterns("/i/health")
.excludePathPatterns("/change/flow/getOperator", "/test/createToDo","/test/progressTodo","/test/submit");
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment