fix(auth/satoken): 修复无法加载 SaToken 全局异常处理器的问题

This commit is contained in:
2024-01-18 23:33:15 +08:00
parent ec0ebd00e4
commit 9984812fed
2 changed files with 2 additions and 6 deletions

View File

@@ -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)

View File

@@ -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