♻️ Refactoring code. 优化配置参数

This commit is contained in:
pig666 committed 2020-05-30 12:26:28 +08:00
1 parent d7bb25f416
commit a800457f7a
3 files changed
+6 -6

No files matched your search

@@ -38,14 +38,14 @@ public class OssAutoConfiguration {
@Bean
@ConditionalOnMissingBean(OssTemplate.class)
@ConditionalOnProperty(name = "oss.endpoint")
OssTemplate awsTemplate() {
@ConditionalOnProperty(name = "oss.enable", havingValue = "true", matchIfMissing = true)
public OssTemplate ossTemplate() {
return new OssTemplate(properties);
}
@Bean
@ConditionalOnProperty(name = "oss.enable", havingValue = "true")
public OssEndpoint awsEndpoint(OssTemplate template) {
@ConditionalOnProperty(name = "oss.public", havingValue = "true", matchIfMissing = true)
public OssEndpoint ossEndpoint(OssTemplate template) {
return new OssEndpoint(template);
}
@@ -58,7 +58,7 @@ public class OssProperties {
* false supports virtual-hosted-style 阿里云等需要配置为
* virtual-hosted-style 模式{http://bucketname.endpoint}
*/
private Boolean pathStyleAccess;
private Boolean pathStyleAccess = true;
/**
* 应用ID
@@ -81,7 +81,7 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory {
try {
String header = request.getHeaders().getFirst(HttpHeaders.AUTHORIZATION);
String clientId = WebUtils.extractClientId(header).orElse(null);
if (clientId != null && filterIgnorePropertiesConfig.getClients().contains(clientId)) {
if (StrUtil.isNotBlank(clientId) && filterIgnorePropertiesConfig.getClients().contains(clientId)) {
return chain.filter(exchange);
}