-
InterceptorConfig.java
import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration public class InterceptorConfig implements WebMvcConfigurer{ public void addInterceptors(InterceptorRegistry registry) { InterceptorRegistration inter = registry.addInterceptor(new TokenInterceptor()); inter.addPathPatterns("/**"); inter.excludePathPatterns("/api/login"); inter.excludePathPatterns("/api/loginAdmin"); } }
springboot-全局拦截器
最新推荐文章于 2024-08-28 08:15:51 发布
关键词由CSDN通过智能技术生成