|
@ -17,7 +17,7 @@ public class WebSecurityConfig extends WebMvcConfigurerAdapter {
|
17
|
17
|
}
|
18
|
18
|
|
19
|
19
|
public void addInterceptors(InterceptorRegistry registry) {
|
20
|
|
// 所有已api开头的访问都要进入RedisSessionInterceptor拦截器进行登录验证,并排除login接口(全路径)。必须写成链式,分别设置的话会创建多个拦截器。
|
|
20
|
// 所有访问都要进入RedisSessionInterceptor拦截器进行登录验证,并排除login接口(全路径)。必须写成链式,分别设置的话会创建多个拦截器。
|
21
|
21
|
// 必须写成getSessionInterceptor(),否则SessionInterceptor中的@Autowired会无效
|
22
|
22
|
registry.addInterceptor(getSessionInterceptor()).addPathPatterns("/**").excludePathPatterns("/login");
|
23
|
23
|
super.addInterceptors(registry);
|