package com.nanyan.securitylink.config; import com.nanyan.securitylink.interceptor.HeaderInterceptor; import com.nanyan.securitylink.interceptor.LogResponseTimeInterceptor; import com.nanyan.securitylink.interceptor.LoginInterceptor; import com.nanyan.securitylink.interceptor.UserAccessInterceptor; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import javax.annotation.Resource; @Configuration public class WebConfig extends WebMvcConfigurationSupport { @Resource private LoginInterceptor loginInterceptor; @Resource LogResponseTimeInterceptor logResponseTimeInterceptor; @Resource HeaderInterceptor headerInterceptor; @Override protected void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(headerInterceptor); registry.addInterceptor(loginInterceptor); registry.addInterceptor(logResponseTimeInterceptor); super.addInterceptors(registry); } }