35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
|
|
using AUTS_Server.Service;
|
|||
|
|
using ProjectIntegration;
|
|||
|
|
|
|||
|
|
var builder = WebApplication.CreateBuilder(args);
|
|||
|
|
|
|||
|
|
// Add services to the container.
|
|||
|
|
builder.Services.AddControllersWithViews();
|
|||
|
|
// ע<><D7A2>HttpContextAccessor
|
|||
|
|
builder.Services.AddHttpContextAccessor();
|
|||
|
|
builder.Services.AddSqlSugarClients(builder.Configuration);//ע<><D7A2>sqlsugar
|
|||
|
|
builder.Services.AddScoped<IEncryptionService, EncryptionService>();//ע<><D7A2><EFBFBD><EFBFBD><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD>
|
|||
|
|
builder.Services.AddScoped<IUserOperationLog, UserOperationLog>();///ע<><D7A2><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>
|
|||
|
|
builder.Services.AddScoped<ILogHelperForService, LogHelperForService>();//ע<><D7A2><EFBFBD><EFBFBD>־<EFBFBD><D6BE><EFBFBD><EFBFBD>io<69><6F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
var app = builder.Build();
|
|||
|
|
// Configure the HTTP request pipeline.
|
|||
|
|
if (!app.Environment.IsDevelopment())
|
|||
|
|
{
|
|||
|
|
app.UseExceptionHandler("/Home/Error");
|
|||
|
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|||
|
|
app.UseHsts();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
app.UseHttpsRedirection();
|
|||
|
|
app.UseStaticFiles();
|
|||
|
|
|
|||
|
|
app.UseRouting();
|
|||
|
|
|
|||
|
|
app.UseAuthorization();
|
|||
|
|
|
|||
|
|
app.MapControllerRoute(
|
|||
|
|
name: "default",
|
|||
|
|
pattern: "{controller=Login}/{action=Index}/{id?}");
|
|||
|
|
|
|||
|
|
app.Run();
|