diff --git a/src/Contrib.Wasm/Masa.Contrib.StackSdks.Config.Wasm/MasaStackConfigCache.cs b/src/Contrib.Wasm/Masa.Contrib.StackSdks.Config.Wasm/MasaStackConfigCache.cs index 18b3954..335b20e 100644 --- a/src/Contrib.Wasm/Masa.Contrib.StackSdks.Config.Wasm/MasaStackConfigCache.cs +++ b/src/Contrib.Wasm/Masa.Contrib.StackSdks.Config.Wasm/MasaStackConfigCache.cs @@ -14,7 +14,7 @@ public virtual async Task InitializeAsync() { if (_dccClient != null) { - Section = await _dccClient.OpenApiService.GetStackConfigAsync(Configs.DEFAULT_CONFIG_NAME); + Section = await _dccClient.OpenApiService.GetStackConfigAsync(); } } } \ No newline at end of file diff --git a/src/Contrib.Wasm/Masa.Contrib.StackSdks.Config.Wasm/ServiceCollectionExtensions.cs b/src/Contrib.Wasm/Masa.Contrib.StackSdks.Config.Wasm/ServiceCollectionExtensions.cs index 0ed647d..4003ec6 100644 --- a/src/Contrib.Wasm/Masa.Contrib.StackSdks.Config.Wasm/ServiceCollectionExtensions.cs +++ b/src/Contrib.Wasm/Masa.Contrib.StackSdks.Config.Wasm/ServiceCollectionExtensions.cs @@ -7,20 +7,17 @@ public static class ServiceCollectionExtensions { public static async Task AddMasaStackConfigAsync(this IServiceCollection services, IConfiguration configuration, string environment) { - // »ñÈ¡ÅäÖà var configs = GetConfigMap(configuration, environment); services.TryAddScoped(); services.TryAddSingleton(); - // ×¢²á IMasaStackConfig services.TryAddScoped(sp => { var clientScopeServiceProviderAccessor = sp.GetRequiredService(); return new MasaStackConfig(clientScopeServiceProviderAccessor, configs); }); - // ×¢²á IMultiEnvironmentMasaStackConfig services.TryAddScoped(sp => { var clientScopeServiceProviderAccessor = sp.GetRequiredService(); @@ -49,14 +46,8 @@ private static Dictionary GetConfigMap(IConfiguration configurat { MasaStackConfigConstant.NAMESPACE, configuration.GetValue(MasaStackConfigConstant.NAMESPACE) }, { MasaStackConfigConstant.CLUSTER, configuration.GetValue(MasaStackConfigConstant.CLUSTER) }, { MasaStackConfigConstant.OTLP_URL, configuration.GetValue(MasaStackConfigConstant.OTLP_URL) }, - { MasaStackConfigConstant.REDIS, configuration.GetValue(MasaStackConfigConstant.REDIS) }, - { MasaStackConfigConstant.CONNECTIONSTRING, configuration.GetValue(MasaStackConfigConstant.CONNECTIONSTRING) }, { MasaStackConfigConstant.MASA_STACK, configuration.GetValue(MasaStackConfigConstant.MASA_STACK) }, - { MasaStackConfigConstant.ELASTIC, configuration.GetValue(MasaStackConfigConstant.ELASTIC) }, - { MasaStackConfigConstant.ENVIRONMENT, environment }, - { MasaStackConfigConstant.ADMIN_PWD, configuration.GetValue(MasaStackConfigConstant.ADMIN_PWD) }, - { MasaStackConfigConstant.DCC_SECRET, configuration.GetValue(MasaStackConfigConstant.DCC_SECRET) }, - { MasaStackConfigConstant.SUFFIX_IDENTITY, configuration.GetValue(MasaStackConfigConstant.SUFFIX_IDENTITY) } + { MasaStackConfigConstant.ENVIRONMENT, environment } }; return configs; }