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;

/**
 * @author sunshihao
 * @version 1.0
 * @description: 通过数字签名认证拦截
 * @date 2025/7/30 10:08
 */
@Configuration
public class BearerTokenConfiguration implements WebMvcConfigurer {
    public static String[] urlList = new String[]{"/openapi/**","/analysis/**","/v3/msg/front/commons/sendSmsCode"};

    @Bean
    public BearerTokenInterceptor tokenConfiguration(){
        return new BearerTokenInterceptor();
    }

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

}
