From 9984812fede0de0208ccb5bd94f24b66d60d6f7f Mon Sep 17 00:00:00 2001 From: Charles7c Date: Thu, 18 Jan 2024 23:33:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(auth/satoken):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=8A=A0=E8=BD=BD=20SaToken=20=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=E5=99=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../satoken/autoconfigure/SaTokenAutoConfiguration.java | 6 ++---- .../GlobalExceptionHandlerAutoConfiguration.java | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/continew-starter-auth/continew-starter-auth-satoken/src/main/java/top/charles7c/continew/starter/auth/satoken/autoconfigure/SaTokenAutoConfiguration.java b/continew-starter-auth/continew-starter-auth-satoken/src/main/java/top/charles7c/continew/starter/auth/satoken/autoconfigure/SaTokenAutoConfiguration.java index a4950623..20893cd3 100644 --- a/continew-starter-auth/continew-starter-auth-satoken/src/main/java/top/charles7c/continew/starter/auth/satoken/autoconfigure/SaTokenAutoConfiguration.java +++ b/continew-starter-auth/continew-starter-auth-satoken/src/main/java/top/charles7c/continew/starter/auth/satoken/autoconfigure/SaTokenAutoConfiguration.java @@ -29,10 +29,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.PropertySource; +import org.springframework.context.annotation.*; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import top.charles7c.continew.starter.core.constant.StringConstants; @@ -47,6 +44,7 @@ import top.charles7c.continew.starter.core.handler.GeneralPropertySourceFactory; @Slf4j @AutoConfiguration @RequiredArgsConstructor +@ComponentScan("top.charles7c.continew.starter.auth.satoken.exception") @EnableConfigurationProperties(SaTokenExtensionProperties.class) @ConditionalOnProperty(prefix = "sa-token.extension", name = "enabled", havingValue = "true") @PropertySource(value = "classpath:default-auth-satoken.yml", factory = GeneralPropertySourceFactory.class) diff --git a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/autoconfigure/GlobalExceptionHandlerAutoConfiguration.java b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/autoconfigure/GlobalExceptionHandlerAutoConfiguration.java index 0077d138..f0b54f2f 100644 --- a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/autoconfigure/GlobalExceptionHandlerAutoConfiguration.java +++ b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/autoconfigure/GlobalExceptionHandlerAutoConfiguration.java @@ -20,7 +20,6 @@ import jakarta.annotation.PostConstruct; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController; -import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import top.charles7c.continew.starter.core.exception.GlobalErrorHandler; @@ -36,7 +35,6 @@ import top.charles7c.continew.starter.core.exception.GlobalExceptionHandler; @Configuration(proxyBeanMethods = false) @Import({GlobalExceptionHandler.class, GlobalErrorHandler.class}) @ConditionalOnMissingBean(BasicErrorController.class) -@ComponentScan("top.charles7c.continew.starter.**.exception") public class GlobalExceptionHandlerAutoConfiguration { @PostConstruct