实现拦截器,拦截所有资源话不多说,直接上代码
/**
* @Auther: 叶川江
* @Date: 2021/9/18 12:44
* @Description: 拦截器,路径以/ye开头的会被拦截
*/
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(authenticationInterceptor())