jinpengyong
2021-03-23 9ec895d7754fdfd4918fab69cc220c0d814c41f7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package com.moral.api.config.Interceptor;
 
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
import com.moral.api.interceptor.AuthenticationInterceptor;
 
@Configuration
public class WebAppConfiguration implements WebMvcConfigurer {
 
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AuthenticationInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/**/login/**", "/**/logout/**", "/swagger-ui.html/**", "/swagger-resources/**","/**/verificationCode/**","/**/user/**");
    }
}