潘志宝
2025-03-20 61e09f834e478ab04002f2f2f5f99e71e3c25917
iailab-plat-sdk/src/main/java/com/iailab/sdk/auth/config/SdkAutoConfiguration.java
@@ -1,19 +1,11 @@
package com.iailab.sdk.auth.config;
import com.iailab.sdk.auth.client.IailabAuthClient;
import com.iailab.sdk.auth.factory.YamlPropertySourceFactory;
import com.iailab.sdk.util.http.IailabHttpUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.io.ClassPathResource;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
/**
@@ -21,7 +13,7 @@
 */
@Configuration
@PropertySource(
        value = "classpath:auth.yaml",
        value = "classpath:application.yaml",
        factory = YamlPropertySourceFactory.class  // 使用自定义加载器
)
public class SdkAutoConfiguration {
@@ -40,9 +32,6 @@
    @Value("${iailab.token.username}")
    public String username;
    @Value("${iailab.token.password}")
    public String password;
    public static String BASE_URL;
    public static Long TENANT_ID;
@@ -53,8 +42,6 @@
    public static String USERNAME;
    public static String PASSWORD;
    @PostConstruct
    public void initUrl() {
        BASE_URL = this.baseUrl;
@@ -62,6 +49,5 @@
        CLIENT_ID = this.clientId;
        CLIENT_SECRET = this.clientSecret;
        USERNAME = this.username;
        PASSWORD = this.password;
    }
}