@Configuration
public class WebConfiguration extends WebMvcConfigurerAdapter {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new UserSecurityInterceptor());
}
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**");
}
}
参考文章:http://blog.csdn.net/isea533/article/details/50449907
转载于:https://www.cnblogs.com/lifeix-gcc/p/5391350.html