package com.jeesite.modules.sso.config;

import com.jeesite.modules.sso.filter.AuthorizeFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/***
 * 注册拦截器到Spring容器
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    //自己添加的拦截器
    @Autowired
    private AuthorizeFilter authorizeFilter;



    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(this.authorizeFilter).addPathPatterns("/sso/oauth2/**");
    }
}