commit:同步2.3版本

This commit is contained in:
Jerry
2022-02-20 13:40:36 +08:00
parent c7cc3f5354
commit cbe0f7947d
668 changed files with 172592 additions and 821 deletions

View File

@@ -5,9 +5,9 @@ import com.orangeforms.gateway.filter.AuthenticationPostFilter;
import com.orangeforms.gateway.filter.AuthenticationPreFilter;
import com.orangeforms.gateway.filter.RequestLogFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -19,8 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
* @author Jerry
* @date 2020-08-08
*/
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
@SpringCloudApplication
@EnableDiscoveryClient
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class GatewayApplication {
@RestController

View File

@@ -22,10 +22,14 @@ public class CorsConfig {
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource(new PathPatternParser());
CorsConfiguration config = new CorsConfiguration();
if (StringUtils.isNotBlank(appConfig.getCredentialIpList())) {
String[] credentialIpList = StringUtils.split(appConfig.getCredentialIpList(), ",");
if (credentialIpList.length > 0) {
for (String ip : credentialIpList) {
config.addAllowedOrigin(ip);
if ("*".equals(appConfig.getCredentialIpList())) {
config.addAllowedOriginPattern("*");
} else {
String[] credentialIpList = StringUtils.split(appConfig.getCredentialIpList(), ",");
if (credentialIpList.length > 0) {
for (String ip : credentialIpList) {
config.addAllowedOrigin(ip);
}
}
}
config.addAllowedHeader("*");