diff --git a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/BaseResourceServerConfigurerAdapter.java b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/BaseResourceServerConfigurerAdapter.java index 19a02031f..acf384b52 100644 --- a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/BaseResourceServerConfigurerAdapter.java +++ b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/BaseResourceServerConfigurerAdapter.java @@ -19,6 +19,7 @@ package com.pig4cloud.pigx.common.security.component; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer; import org.springframework.security.core.userdetails.UserDetailsService; @@ -37,6 +38,7 @@ import org.springframework.web.client.RestTemplate; * 2. 支持 获取用户全部信息 */ @Slf4j +@Configuration public class BaseResourceServerConfigurerAdapter extends ResourceServerConfigurerAdapter { @Autowired protected ResourceAuthExceptionEntryPoint resourceAuthExceptionEntryPoint; diff --git a/pigx-config/src/main/resources/config/application-dev.yml b/pigx-config/src/main/resources/config/application-dev.yml index 333a0a25b..eb432d31f 100644 --- a/pigx-config/src/main/resources/config/application-dev.yml +++ b/pigx-config/src/main/resources/config/application-dev.yml @@ -98,6 +98,11 @@ swagger: ## spring security 配置 security: oauth2: + client: + # 默认放行url,如果子模块重写这里的配置就会被覆盖 + ignore-urls: + - '/actuator/**' + - '/v2/api-docs' resource: loadBalanced: true token-info-uri: http://pigx-auth/oauth/check_token @@ -105,5 +110,5 @@ security: # log配置 logging: level: - root: warn + root: error com.pig4cloud.pigx: info diff --git a/pigx-config/src/main/resources/config/pigx-activiti-dev.yml b/pigx-config/src/main/resources/config/pigx-activiti-dev.yml index 5548ba502..fddf791dc 100644 --- a/pigx-config/src/main/resources/config/pigx-activiti-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-activiti-dev.yml @@ -6,6 +6,8 @@ security: client-secret: ENC(gPFcUOmJm8WqM3k3eSqS0Q==) scope: server ignore-urls: + - '/actuator/**' + - '/v2/api-docs' - '/service/**' - '/editor-app/**' - '/task/view/*' diff --git a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml index 901f7526c..0d54f50ac 100644 --- a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml @@ -5,10 +5,6 @@ security: client-id: ENC(gPFcUOmJm8WqM3k3eSqS0Q==) client-secret: ENC(gPFcUOmJm8WqM3k3eSqS0Q==) scope: server - ignore-urls: - - '/actuator/**' - - '/v2/api-docs' - # 数据源配置 spring: datasource: diff --git a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml index e662ed4fa..1dbdbb725 100644 --- a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml @@ -5,9 +5,6 @@ security: client-id: ENC(tz2NM4GcmnE7sNJTYL8ZSg==) client-secret: ENC(tz2NM4GcmnE7sNJTYL8ZSg==) scope: server - ignore-urls: - - '/actuator/**' - - '/v2/api-docs' ## 定时任务 spring: # 保存定时任务的数据源 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 a6987bd9d..adf7eb8af 100644 --- a/pigx-config/src/main/resources/config/pigx-upms-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-upms-dev.yml @@ -5,6 +5,7 @@ security: client-id: ENC(ltJPpR50wT0oIY9kfOe1Iw==) client-secret: ENC(ltJPpR50wT0oIY9kfOe1Iw==) scope: server + # 默认放行url,子模块重写时application-dev.yml中的公共配置会被覆盖,所以要把公共配置中的放行url再写一次 ignore-urls: - '/actuator/**' - '/v2/api-docs'