123456789101112131415161718192021222324 |
- package com.yaozhitech.spring5.config;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.web.servlet.HandlerInterceptor;
- import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
- import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
- import com.yaozhitech.spring5.intercept.ServiceAuthRestInterceptor;
- @Configuration
- public class WebSecurityConfig implements WebMvcConfigurer{
- @Bean
- public HandlerInterceptor serviceAuthRestInterceptor() {
- return new ServiceAuthRestInterceptor();
- }
- @Override
- public void addInterceptors(InterceptorRegistry registry) {
- registry.addInterceptor(serviceAuthRestInterceptor());
- }
- }
|