修复了SimApiAuthGateClient初始化BUG
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
using SimApi.Configurations;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using SimApi.Configurations;
|
||||
using SimApi.Helpers;
|
||||
|
||||
namespace SimApi.AuthGate;
|
||||
|
||||
public class SimApiAuthGateClient(SimApiOptions apiOptions) : SimApiHttpClient
|
||||
public class SimApiAuthGateClient(SimApiOptions apiOptions, ILogger<SimApiAuthGateClient> logger)
|
||||
: SimApiHttpClient(apiOptions, logger)
|
||||
{
|
||||
public override string Server { get; init; } = apiOptions.SimApiAuthGateOptions.Server ?? string.Empty;
|
||||
public override string AppId { get; init; } = apiOptions.SimApiAuthGateOptions.AppId ?? string.Empty;
|
||||
|
||||
@@ -11,4 +11,5 @@ public class SimApiAuthGateOptions
|
||||
/// 注意: 只有内部应用需要开启这个,也就是api通过内部网关代理后
|
||||
/// </summary>
|
||||
public bool UseMiddleware { get; set; }
|
||||
public bool UseIam { get; set; }
|
||||
}
|
||||
+4
-1
@@ -333,7 +333,10 @@ public static class SimApiExtensions
|
||||
{
|
||||
builder.AddSingleton<SimApiAuthGateClient>();
|
||||
builder.AddSingleton<SimApiAuthGate>();
|
||||
builder.AddSingleton<SimApiIam>();
|
||||
if (simApiOptions.SimApiAuthGateOptions.UseIam)
|
||||
{
|
||||
builder.AddSingleton<SimApiIam>();
|
||||
}
|
||||
}
|
||||
|
||||
builder.AddSingleton(simApiOptions);
|
||||
|
||||
Reference in New Issue
Block a user