static 跨域配置
This commit is contained in:
parent
a3b71073b4
commit
6ad66d58e3
|
@ -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/**");
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue