mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:13:26 +08:00
【升级】升级Asp.Net 6.0.11 到 Asp.Net 7.0.0
【升级】升级所有组建包,移除一些不用或者版本弃用的组建。 【优化】优化升级npoi最新版后,出现导出数据兼容性的问题。 【优化】使用新的【NLog.Database】nlog数据库链接组件,解决nlog升级到5.x以后版本记录到数据库日志失败的问题。
This commit is contained in:
@@ -54,9 +54,6 @@ builder.Services.AddSession();
|
||||
// AutoMapper支持
|
||||
builder.Services.AddAutoMapper(typeof(AutoMapperConfiguration));
|
||||
|
||||
//使用 SignalR
|
||||
builder.Services.AddSignalR();
|
||||
|
||||
// 引入Payment 依赖注入(支付宝支付/微信支付)
|
||||
builder.Services.AddAlipay();
|
||||
builder.Services.AddWeChatPay();
|
||||
@@ -144,14 +141,10 @@ builder.Host.ConfigureContainer<ContainerBuilder>(containerBuilder =>
|
||||
#endregion
|
||||
|
||||
#region Nlog注册============================================================================
|
||||
|
||||
builder.Host.ConfigureLogging(logging =>
|
||||
{
|
||||
logging.ClearProviders(); //移除已经注册的其他日志处理程序
|
||||
logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace); //设置最小的日志级别
|
||||
})
|
||||
.UseNLog(); //NLog: Setup NLog for Dependency injection
|
||||
|
||||
// NLog: Setup NLog for Dependency injection
|
||||
builder.Logging.ClearProviders();//移除已经注册的其他日志处理程序
|
||||
builder.Logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace); //设置最小的日志级别
|
||||
builder.Host.UseNLog();
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -175,8 +168,6 @@ app.UseRequestResponseLog();
|
||||
app.UseRecordAccessLogsMildd(GlobalEnumVars.CoreShopSystemCategory.Admin.ToString());
|
||||
// 记录ip请求 (注意开启权限,不然本地无法写入)
|
||||
app.UseIpLogMildd();
|
||||
// signalr
|
||||
app.UseSignalRSendMildd();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -223,17 +214,9 @@ app.UseAuthentication();
|
||||
// 然后是授权中间件
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllerRoute(
|
||||
"areas",
|
||||
"{area:exists}/{controller=Default}/{action=Index}/{id?}"
|
||||
);
|
||||
|
||||
endpoints.MapControllerRoute(
|
||||
"default",
|
||||
"{controller=Home}/{action=Index}/{id?}");
|
||||
});
|
||||
app.MapControllerRoute(
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||
|
||||
|
||||
//设置默认起始页(如default.html)
|
||||
|
||||
Reference in New Issue
Block a user