mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-11 05:19:00 +08:00
💚 修正注释文案错误问题等
This commit is contained in:
1 parent
f8b4400897
commit
86b0cd228e
8 files changed
+8
-37
No files matched your search
@@ -1,28 +0,0 @@
|
||||
package com.pig4cloud.pigx.gateway.config;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.cloud.gateway.config.GlobalCorsProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.cors.reactive.CorsWebFilter;
|
||||
import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource;
|
||||
|
||||
|
||||
/**
|
||||
* Spring Cloud Gateway 跨域配置
|
||||
*
|
||||
* @author jclazz
|
||||
* @date 7/5/2019
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@Configuration
|
||||
public class GlobalCorsConfig {
|
||||
@ConditionalOnBean(GlobalCorsProperties.class)
|
||||
@Bean
|
||||
CorsWebFilter corsWebFilter(GlobalCorsProperties globalCorsProperties) {
|
||||
UrlBasedCorsConfigurationSource source =
|
||||
new UrlBasedCorsConfigurationSource();
|
||||
source.setCorsConfigurations(globalCorsProperties.getCorsConfigurations());
|
||||
return new CorsWebFilter(source);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user