|
@@ -25,6 +25,7 @@ import org.springframework.http.converter.StringHttpMessageConverter;
|
|
|
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
|
|
import org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter;
|
|
|
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
|
|
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
|
@@ -44,9 +45,18 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|
|
@Resource
|
|
|
private LoginUserHandlerMethodArgumentResolver loginUserHandlerMethodArgumentResolver;
|
|
|
|
|
|
+ @Override
|
|
|
+ public void addCorsMappings(CorsRegistry registry) {
|
|
|
+ registry.addMapping("/**")
|
|
|
+ .allowedOriginPatterns("*")
|
|
|
+ .allowCredentials(true)
|
|
|
+ .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
|
|
+ .maxAge(3600);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
|
- registry.addInterceptor(authorizationInterceptor).addPathPatterns("/api/**");
|
|
|
+ registry.addInterceptor(authorizationInterceptor).addPathPatterns("/client/**");
|
|
|
}
|
|
|
|
|
|
@Override
|