package com.huimv.admin.session.config;

//import com.huimv.session.WebApiInterceptor;
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;

@Configuration
public class AppTokenConfiguration implements WebMvcConfigurer {

//    @Bean
//    public WebApiInterceptor webApiInterceptor() {
//        return new WebApiInterceptor();
//    }
//
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //多个拦截器组成一个拦截器链
        //addPathPattern 用于添加拦截规则 路径，是带api接口的
        //用于定义、排除用户的拦截
        registry.addInterceptor(new WebApiInterceptor())
                .addPathPatterns("/**");
//                .excludePathPatterns(
//                		"/my/login",
//                        "/my/logout");
    }

}