pull/60/head
diaobisong 2 years ago
parent 9a0a8035b9
commit ffb8bbdd3b

@ -1,7 +1,9 @@
package com.java3y.austin.web.config; package com.java3y.austin.web.config;
import com.java3y.austin.web.interceptor.TokenInterceptor;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/** /**
@ -19,4 +21,9 @@ public class CrossConfig implements WebMvcConfigurer {
.maxAge(3600) .maxAge(3600)
.allowedHeaders("*"); .allowedHeaders("*");
} }
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new TokenInterceptor()).addPathPatterns("/**");
}
} }

Loading…
Cancel
Save