| 1234567891011121314151617181920212223242526272829 |
- package com.huimv.admin.config;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
- import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
- /**
- * @Description: 注册验证tocken的拦截器
- * @Author
- * @Date 2021/4/19 20:41
- * @Version V1.0
- */
- @Configuration
- public class InterceptorConfig implements WebMvcConfigurer {
- @Bean
- public JWTInterceptor jwtInterceptor(){
- return new JWTInterceptor();
- }
- @Override
- public void addInterceptors(InterceptorRegistry registry) {
- registry.addInterceptor(jwtInterceptor()).
- excludePathPatterns("/*/my/*").
- excludePathPatterns(("/env-electricity/testList")).
- excludePathPatterns("/env-water/testList").
- excludePathPatterns("/envDevice/getList");
- }
- }
|