using DS.Module.Core.Modules; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; namespace DS.Module.UserModule; /// /// 用户信息模块 /// public class UserModule : DSAppModule { public override void ConfigureServices(ConfigureServicesContext context) { context.Services.AddTransient(provider => { IHttpContextAccessor accessor = provider.GetService(); return accessor?.HttpContext?.Request.GetUserInfo(); }); } }