diff --git a/src/main/java/com/fc/v2/common/interceptor/MyWebAppConfigurer.java b/src/main/java/com/fc/v2/common/interceptor/MyWebAppConfigurer.java index 2a1fb8d..4c33f1d 100644 --- a/src/main/java/com/fc/v2/common/interceptor/MyWebAppConfigurer.java +++ b/src/main/java/com/fc/v2/common/interceptor/MyWebAppConfigurer.java @@ -3,7 +3,9 @@ package com.fc.v2.common.interceptor; import java.io.File; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -45,4 +47,14 @@ public class MyWebAppConfigurer implements WebMvcConfigurer { } + @Bean + public WebMvcConfigurer corsConfigurer() { + return new WebMvcConfigurer() { + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/static/**"); + } + + }; + } } \ No newline at end of file