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