You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
556 B
C#

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