|
|
|
@@ -1,9 +1,6 @@ |
|
|
|
package com.xueyi.common.security.config; |
|
|
|
|
|
|
|
import com.xueyi.common.security.interceptor.HeaderInterceptor; |
|
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
import org.springframework.web.cors.CorsConfiguration; |
|
|
|
import org.springframework.web.servlet.config.annotation.CorsRegistry; |
|
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
|
|
|
|
|
|
|
@@ -19,18 +16,6 @@ public class WebMvcConfig implements WebMvcConfigurer { |
|
|
|
*/ |
|
|
|
public static final String[] excludeUrls = {"/login", "/logout", "/refresh"}; |
|
|
|
|
|
|
|
@Bean |
|
|
|
public WebMvcConfigurer corsConfigurer() { |
|
|
|
return new WebMvcConfigurer() { |
|
|
|
@Override |
|
|
|
public void addCorsMappings(final CorsRegistry registry) { |
|
|
|
registry.addMapping("/**/graphql/**") |
|
|
|
.allowedOrigins(CorsConfiguration.ALL) |
|
|
|
.allowedHeaders(CorsConfiguration.ALL) |
|
|
|
.allowedMethods(CorsConfiguration.ALL); |
|
|
|
} |
|
|
|
}; |
|
|
|
} |
|
|
|
@Override |
|
|
|
public void addInterceptors(InterceptorRegistry registry) { |
|
|
|
registry.addInterceptor(getHeaderInterceptor()) |
|
|
|
|