package com.slodon.b2b2c.interceptor;

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;

/**
 * Sso拦截器配置
 *
 * @author cyan
 */
@Configuration
public class SsoConfiguration implements WebMvcConfigurer {
    public static String[] urlList = new String[]{"v3/open/api/sso/login/**"};

    @Bean
    public SsoInterceptor ssoInterceptor() {
        return new SsoInterceptor();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(ssoInterceptor()).addPathPatterns(urlList);
    }
}
