package com.boman.web.core.interceptor;

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;

/**拦截器的注册
 * @author tjf
 * @Date: 2022/03/20/17:14
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry interceptorRegistry) {
        InterceptorRegistration registration=interceptorRegistry.addInterceptor(new ControllerTimeInterceptor());
        // 此处添加拦截策略 /**表示全部拦截
        registration.addPathPatterns("/core/czrk/**");
        registration.addPathPatterns("/core/jzdz/**");
        registration.addPathPatterns("/core/ryrl/**");
    }
}
