kyy
2025-10-22 7d772840712a8dd5be125ba70060a1bf1bf322d6
Startup.cs
@@ -1,5 +1,6 @@
using System.Reflection;
using Microsoft.OpenApi.Models;
using NewPdaSqlServer.entity.Base;
using NewPdaSqlServer.util;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
@@ -26,6 +27,12 @@
    {
        services.AddControllers();
        // 注册 HttpContextAccessor
        services.AddHttpContextAccessor();
        // 注册 RequestInfo 为 Scoped 服务
        services.AddScoped<RequestInfo>();
        // 读取 系统 设置并注入到服务中
        services.Configure<AppSettings>(
            Configuration.GetSection("AppSettings"));