111
啊鑫
2025-09-24 4db3ba3f84456c27fdd9be76ff76c17101270914
Startup.cs
@@ -26,6 +26,12 @@
    {
        services.AddControllers();
        // 注册 HttpContextAccessor
        services.AddHttpContextAccessor();
        // 注册 RequestInfo 为 Scoped 服务
        services.AddScoped<RequestInfo>();
        // 读取 系统 设置并注入到服务中
        services.Configure<AppSettings>(
            Configuration.GetSection("AppSettings"));