diff --git a/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java b/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java index 60cd4ea48..97afe4707 100644 --- a/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java +++ b/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java @@ -87,6 +87,7 @@ public class SwaggerAutoConfiguration { /** * 配置默认的全局鉴权策略的开关,通过正则表达式进行匹配;默认匹配所有URL + * * @return */ private SecurityContext securityContext() { @@ -103,7 +104,7 @@ public class SwaggerAutoConfiguration { */ private List defaultAuth() { ArrayList authorizationScopeList = new ArrayList<>(); - swaggerProperties().getAuthorization().getAuthorizationScopeList().forEach(authorizationScope->authorizationScopeList.add(new AuthorizationScope(authorizationScope.getScope(),authorizationScope.getDescription()))); + swaggerProperties().getAuthorization().getAuthorizationScopeList().forEach(authorizationScope -> authorizationScopeList.add(new AuthorizationScope(authorizationScope.getScope(), authorizationScope.getDescription()))); AuthorizationScope[] authorizationScopes = new AuthorizationScope[authorizationScopeList.size()]; return Collections.singletonList(SecurityReference.builder() .reference(swaggerProperties().getAuthorization().getName()) @@ -114,9 +115,9 @@ public class SwaggerAutoConfiguration { private OAuth securitySchema() { ArrayList authorizationScopeList = new ArrayList<>(); - swaggerProperties().getAuthorization().getAuthorizationScopeList().forEach(authorizationScope->authorizationScopeList.add(new AuthorizationScope(authorizationScope.getScope(),authorizationScope.getDescription()))); + swaggerProperties().getAuthorization().getAuthorizationScopeList().forEach(authorizationScope -> authorizationScopeList.add(new AuthorizationScope(authorizationScope.getScope(), authorizationScope.getDescription()))); ArrayList grantTypes = new ArrayList<>(); - swaggerProperties().getAuthorization().getTokenUrlList().forEach(tokenUrl->grantTypes.add(new ResourceOwnerPasswordCredentialsGrant(tokenUrl))); + swaggerProperties().getAuthorization().getTokenUrlList().forEach(tokenUrl -> grantTypes.add(new ResourceOwnerPasswordCredentialsGrant(tokenUrl))); return new OAuth(swaggerProperties().getAuthorization().getName(), authorizationScopeList, grantTypes); } diff --git a/pigx-config/src/main/resources/config/pigx-upms-dev.yml b/pigx-config/src/main/resources/config/pigx-upms-dev.yml index 98df2c4bc..4e29bb29c 100644 --- a/pigx-config/src/main/resources/config/pigx-upms-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-upms-dev.yml @@ -2,8 +2,8 @@ security: oauth2: client: - client-id: pigx - client-secret: pigx + client-id: pig + client-secret: pig scope: server resource: token-info-uri: http://localhost:9999/auth/oauth/check_token diff --git a/pigx-eureka/src/main/resources/bootstrap.yml b/pigx-eureka/src/main/resources/bootstrap.yml index e933fbe80..b5d334125 100644 --- a/pigx-eureka/src/main/resources/bootstrap.yml +++ b/pigx-eureka/src/main/resources/bootstrap.yml @@ -13,7 +13,7 @@ spring: # 类似的 redis 使用pigx-redis ,gateway 换成 pigx-gateway eureka: instance: - hostname: pigx-eureka + hostname: localhost prefer-ip-address: true client: register-with-eureka: true