|
@@ -61,7 +61,7 @@ internal static class StartupExtensions
|
|
|
#if DEBUG
|
|
|
builder.WebHost.UseUrls("http://*:50100");
|
|
|
#endif
|
|
|
-
|
|
|
+
|
|
|
services.Configure<IdentityConfiguration>(d => configuration.GetSection(nameof(IdentityConfiguration)).Bind(d));
|
|
|
|
|
|
var appConfigurationSection = configuration.GetRequiredSection(nameof(AppConfiguration));
|
|
@@ -74,10 +74,10 @@ internal static class StartupExtensions
|
|
|
services.Configure<CallCenterConfiguration>(d => callCenterConfigurationSection.Bind(d));
|
|
|
|
|
|
services.Configure<CityBaseConfiguration>(d => configuration.GetSection(nameof(CityBaseConfiguration)).Bind(d));
|
|
|
- //services.Configure<SendSmsConfiguration>(d => configuration.GetSection("SendSms").Bind(d));
|
|
|
+ //services.Configure<SendSmsConfiguration>(d => configuration.GetSection("SendSms").Bind(d));
|
|
|
|
|
|
- // Add services to the container.
|
|
|
- services
|
|
|
+ // Add services to the container.
|
|
|
+ services
|
|
|
.BatchInjectServices(d =>
|
|
|
{
|
|
|
var attr = d.GetCustomAttribute(typeof(InjectionAttribute)) as InjectionAttribute;
|
|
@@ -90,11 +90,11 @@ internal static class StartupExtensions
|
|
|
.AddScoped(typeof(IPasswordHasher<>), typeof(PasswordHasher<>))
|
|
|
.AddHttpClient()
|
|
|
;
|
|
|
-
|
|
|
+
|
|
|
services.AddKeyedScoped<ISessionContext, ProvinceSessionContext>(ProvinceSessionContext.Key)
|
|
|
.AddKeyedScoped<ISessionContext, Police110SessionContext>(Police110SessionContext.Key)
|
|
|
;
|
|
|
-
|
|
|
+
|
|
|
//cache
|
|
|
services.AddCache(d =>
|
|
|
{
|
|
@@ -149,7 +149,7 @@ internal static class StartupExtensions
|
|
|
.AddKeyedScoped<ISessionContext, ZzptSessionContext>(ZzptSessionContext.Key);
|
|
|
break;
|
|
|
case AppDefaults.AppScope.ZiGong:
|
|
|
- services.AddAiXingTang(appConfiguration.ZiGong.AiQuality.Url);
|
|
|
+ services.AddAiXingTang(appConfiguration.ZiGong.AiQuality.Url);
|
|
|
break;
|
|
|
case AppDefaults.AppScope.LuZhou:
|
|
|
break;
|
|
@@ -227,12 +227,14 @@ internal static class StartupExtensions
|
|
|
|
|
|
services.AddScoped<IGuiderSystemService, TiqnQueService>();
|
|
|
|
|
|
- services.AddSingleton<ClientIpFilterAttribute>(sp =>
|
|
|
+ services.AddScoped<ClientIpFilterAttribute>(sp =>
|
|
|
{
|
|
|
var loggerFactory = sp.GetService<ILoggerFactory>();
|
|
|
var logger = loggerFactory.CreateLogger<ClientIpFilterAttribute>();
|
|
|
var cacheManager = sp.GetService<ISystemSettingCacheManager>();
|
|
|
- var whiteIps = cacheManager.GetSetting(SettingConstants.WhiteIp).SettingValue;
|
|
|
+ var whiteIps = cacheManager.GetSetting(SettingConstants.WhiteIp).SettingValue
|
|
|
+ .Where(d => !string.IsNullOrEmpty(d))
|
|
|
+ .ToList();
|
|
|
|
|
|
return new ClientIpFilterAttribute(whiteIps, logger);
|
|
|
});
|