package com.gear.customer.swx.config; import com.gear.customer.swx.filter.CustomInterceptor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration public class WebConfig implements WebMvcConfigurer { @Autowired private CustomInterceptor customInterceptor; @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(customInterceptor) .addPathPatterns("/swx/customer/**") // 拦截所有路径 .excludePathPatterns("/swx/customer/index/**","/swx/customer/login/**"); // 不拦截的路径 //信息展示类、注册、登陆不拦截 } }