package com.huiju.estateagents.config;

import com.huiju.estateagents.interceptor.AccessInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author FXF
 * @date 2019-02-22
 */
@Configuration
public class AccessConfig implements WebMvcConfigurer {

	@Resource
	private AccessInterceptor accessInterceptor;

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		// 自定义拦截器，添加拦截路径和排除拦截路径
		registry.addInterceptor(accessInterceptor).addPathPatterns("/**");
	}
	
}
