parent
5c8601ca38
commit
34ec151277
@ -0,0 +1,18 @@
|
|||||||
|
package com.taxi.apipassenger.interceptor;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Configurable;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class InterceptorConfig implements WebMvcConfigurer {
|
||||||
|
@Override
|
||||||
|
public void addInterceptors(InterceptorRegistry registry) {
|
||||||
|
// WebMvcConfigurer.super.addInterceptors(registry);
|
||||||
|
registry.addInterceptor(new JwtInterceptor())
|
||||||
|
.addPathPatterns("/**")//拦截的路径
|
||||||
|
.excludePathPatterns("/noauthTest");//不拦截的路径
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue