mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-16 07:59:54 +08:00
21 lines
568 B
C#
21 lines
568 B
C#
![]() |
namespace Infrastructure.Auth
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 当前登录用户相关
|
|||
|
/// </summary>
|
|||
|
public class UserContext
|
|||
|
{
|
|||
|
public static dynamic CurrentUser
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
IAuthenticationService authenticationService = DIContainer.ResolvePerHttpRequest<IAuthenticationService>();
|
|||
|
var currentUser = authenticationService.GetAuthenticatedUser();
|
|||
|
if (currentUser != null)
|
|||
|
return currentUser;
|
|||
|
return null;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|