|
|
@@ -1,5 +1,6 @@
|
|
|
package cn.iaun.it.config;
|
|
|
|
|
|
+import cn.iaun.it.interceptor.PermissionInterceptor;
|
|
|
import cn.iaun.it.interceptor.TokenInterceptor;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
@@ -16,6 +17,11 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|
|
registry.addInterceptor(getTokenInterceptor())
|
|
|
.addPathPatterns("/**")
|
|
|
.excludePathPatterns("/user/login");
|
|
|
+
|
|
|
+ registry.addInterceptor(getPermissionInterceptor())
|
|
|
+ .addPathPatterns("/**")
|
|
|
+ .excludePathPatterns("/user/**");
|
|
|
+
|
|
|
WebMvcConfigurer.super.addInterceptors(registry);
|
|
|
}
|
|
|
|
|
|
@@ -32,4 +38,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|
|
public TokenInterceptor getTokenInterceptor() {
|
|
|
return new TokenInterceptor();
|
|
|
}
|
|
|
+
|
|
|
+ @Bean
|
|
|
+ public PermissionInterceptor getPermissionInterceptor() {
|
|
|
+ return new PermissionInterceptor();
|
|
|
+ }
|
|
|
}
|