Parcourir la source

:wrench: 修改配置文件。调整配置

冷冷 il y a 7 ans
Parent
commit
ca9f8bb0a9

+ 4 - 3
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<SecurityReference> defaultAuth() {
 		ArrayList<AuthorizationScope> 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<AuthorizationScope> 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<GrantType> 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);
 	}
 

+ 2 - 2
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

+ 1 - 1
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