Former-commit-id: 3a12e0951606c910ec0e1b639fe61d0baaf5d512
Former-commit-id: 19e5e6b62a8e2fbacf43042f73ece2596fb4bb6f
1.0
wanggang 4 years ago
parent 38ae0648f3
commit 0ce13a736c

@ -12,14 +12,18 @@ namespace Infrastructure.Extensions
.ToDictionary(o => o.Split('=')[0], o => o.Split('=')[1]);
}
public static string GetAppSetting(this IConfiguration configuration, string name, string defaultValue = null)
public static string GetAppSetting(this IConfiguration configuration, string name)
{
return configuration.GetSection("AppSettings").GetValue<string>(name, defaultValue);
return configuration.GetSection("AppSettings").GetValue<string>(name);
}
public static T GetAppSetting<T>(this IConfiguration configuration, string name, T defaultValue)
{
return configuration.GetSection("AppSettings").GetValue(name, defaultValue);
}
public static Dictionary<string, string> GetAppSettings(this IConfiguration configuration, string name, string defaultValue = null)
public static Dictionary<string, string> GetAppSettings(this IConfiguration configuration, string name)
{
return configuration.GetAppSetting(name).Split(';')
return configuration.GetAppSetting(name,"").Split(';')
.ToDictionary(o => o.Split('=')[0], o => o.Split('=')[1]);
}
}

@ -20,7 +20,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.4" />
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.4" />
<PackageReference Include="NJsonSchema" Version="10.3.11" />
<PackageReference Include="NJsonSchema" Version="10.4.0" />
<PackageReference Include="System.ServiceModel.Http" Version="4.8.1" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.8.1" />
<PackageReference Include="Minio" Version="3.1.13" />
@ -28,16 +28,16 @@
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.0-alpha.2" />
<PackageReference Include="DotNetCore.NPOI" Version="1.2.3" />
<PackageReference Include="HtmlAgilityPack.NetCore" Version="1.5.0.1" />
<PackageReference Include="MailKit" Version="2.10.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Serilog.AspNetCore" Version="4.0.0" />
<PackageReference Include="MailKit" Version="2.11.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.InfluxDB.Standard" Version="1.0.5" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.1.1" />
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<PackageReference Include="System.Management" Version="5.0.0" />
<PackageReference Include="ValueInjecter" Version="3.2.0" />

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Kveer.XmlRPC" Version="1.1.1" />
<PackageReference Include="Serilog.AspNetCore" Version="4.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
</ItemGroup>

@ -27,6 +27,7 @@ namespace Platform.Controllers
this._statisticRepo = statisticRepo;
}
[Authorize]
public IActionResult Index()
{
return View();

@ -7,14 +7,14 @@
<Version>1.1.1.1</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.18" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.20" />
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.3" />
<PackageReference Include="Hangfire.Storage.SQLite" Version="0.2.4" />
<PackageReference Include="Hangfire.Storage.SQLite" Version="0.3.0" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
<PackageReference Include="MiniProfiler.EntityFrameworkCore" Version="4.2.22" />
<PackageReference Include="Serilog.Sinks.SQLite" Version="5.0.0" />
<PackageReference Include="sqlite-net-pcl" Version="1.7.335" />
<PackageReference Include="Microsoft.ReverseProxy" Version="1.0.0-preview.7.20562.2" />
<PackageReference Include="Microsoft.ReverseProxy" Version="1.0.0-preview.9.21116.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />

@ -25,7 +25,7 @@ namespace Platform
.ReadFrom.Configuration(config, ConfigurationAssemblySource.AlwaysScanDllFiles)
.WriteTo.Console();
logConfig = config.GetSection("AppSetting").GetValue("Log", "File") == "File"
logConfig = config.GetSection("AppSettings").GetValue("Log", "File") == "File"
? logConfig.WriteTo.File("logs/log.txt", rollOnFileSizeLimit: true, fileSizeLimitBytes: 100 * 1024 * 1024, rollingInterval: RollingInterval.Infinite)
: logConfig.WriteTo.SQLite(Path.Combine(Directory.GetCurrentDirectory(), "log.db"));

@ -35,6 +35,9 @@ namespace Platform
{
services.AddMiniProfiler(o => {
o.RouteBasePath = "/profiler";// /profiler/results-index /profiler/results
o.ResultsAuthorize = o => {
return Configuration.GetAppSetting("Profiler", false) == true;
};
}).AddEntityFramework();
services.AddTransient<SceneTiggerService>();
services.AddTransient<ISceneTiggerService, CachedSceneTiggerService>();

@ -7,7 +7,9 @@
}
},
"AppSettings": {
"Database": "SQLite"
"Database": "SQLite",
"JobDatabase": "SQLite",
"Profiler": true
},
"ReverseProxy": {
"Routes": [

@ -18,6 +18,7 @@
"Log": "SQLite",
"FileServer": "MinIO",
"Cache": "Redis",
"Profiler": false,
"sms": "url=https://api.netease.im/sms/sendcode.action;key=54ebdf1f4364ddd8ff6f82f88d630a76;secret=c49d42b67798@"
},
"ConnectionStrings": {

Loading…
Cancel
Save