update ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java.
org.springframework.web.cors.CorsConfiguration#setAllowedOriginPatterns 在对比allowedOrigins仅支持“*”和不能与使用allowCredentials 其次主要认为跨域这个问题应该交由反向代理或者放置SpringBoot Static 目录中, 通过Static Server 方式, 或者 Nginx 反向代理 至于开发环境应该交由 webpack Proxy 解决
This commit is contained in:
@ -51,7 +51,6 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|||||||
{
|
{
|
||||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||||
CorsConfiguration config = new CorsConfiguration();
|
CorsConfiguration config = new CorsConfiguration();
|
||||||
config.setAllowCredentials(true);
|
|
||||||
// 设置访问源地址
|
// 设置访问源地址
|
||||||
config.addAllowedOrigin("*");
|
config.addAllowedOrigin("*");
|
||||||
// 设置访问源请求头
|
// 设置访问源请求头
|
||||||
|
Reference in New Issue
Block a user