|
|
|
@ -20,6 +20,7 @@ using AutoMapper;
|
|
|
|
|
using System.Reflection; |
|
|
|
|
using Elight.Entity; |
|
|
|
|
using _24Hour; |
|
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
|
|
|
|
|
|
#region builder |
|
|
|
|
|
|
|
|
@ -177,7 +178,10 @@ builder.Services.AddHttpClient<WechatMessagerClient>(opt =>
|
|
|
|
|
{ |
|
|
|
|
opt.BaseAddress = new Uri("https://api.weixin.qq.com/sns"); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
builder.Services.AddHttpClient<CaseServiceTwentyClient>(opt => |
|
|
|
|
{ |
|
|
|
|
opt.BaseAddress = new Uri(Configuration.GetSection("CaseTwenty:SysAddress").Value); |
|
|
|
|
}); |
|
|
|
|
//builder.Services.AddAuthorization(); |
|
|
|
|
builder.Services.AddHttpContextAccessor(); |
|
|
|
|
builder.Services.AddScoped<WebSocketController>(); |
|
|
|
@ -195,6 +199,11 @@ builder.Services.AddScoped<SqlSugarClient>(sp =>
|
|
|
|
|
}); |
|
|
|
|
return db; |
|
|
|
|
}); |
|
|
|
|
//添加httpclient 日志记录 |
|
|
|
|
builder.Services.AddHttpLogging(logging => |
|
|
|
|
{ |
|
|
|
|
logging.LoggingFields = Microsoft.AspNetCore.HttpLogging.HttpLoggingFields.All; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
#region 定时任务 |
|
|
|
|
// 配置Quartz.NET调度器 |
|
|
|
@ -244,6 +253,9 @@ app.UseWebSockets(new WebSocketOptions
|
|
|
|
|
app.UseStaticFiles(); |
|
|
|
|
//app.UseHttpsRedirection(); |
|
|
|
|
//路由 |
|
|
|
|
|
|
|
|
|
//使用httpclient日志记录 必须在UseStaticFiles下面 |
|
|
|
|
app.UseHttpLogging(); |
|
|
|
|
app.UseRouting(); |
|
|
|
|
app.UseAuthentication(); // 启用身份验证中间件 |
|
|
|
|
app.UseAuthorization(); // 启用授权中间件 |
|
|
|
|