|
@@ -1,19 +1,15 @@
|
|
using System.Security.Authentication;
|
|
using System.Security.Authentication;
|
|
using System.Security.Claims;
|
|
using System.Security.Claims;
|
|
-using Hotline.Repository.SqlSugar;
|
|
|
|
-using Hotline.Users;
|
|
|
|
using IdentityModel;
|
|
using IdentityModel;
|
|
-using SqlSugar;
|
|
|
|
-using XF.Domain.Authentications;
|
|
|
|
|
|
+using Microsoft.AspNetCore.Http;
|
|
using XF.Domain.Dependency;
|
|
using XF.Domain.Dependency;
|
|
-using XF.Domain.Exceptions;
|
|
|
|
using XF.Utility.AppIdentityModel;
|
|
using XF.Utility.AppIdentityModel;
|
|
|
|
|
|
-namespace Hotline.Api.Token
|
|
|
|
|
|
+namespace XF.Domain.Authentications
|
|
{
|
|
{
|
|
public class DefaultSessionContext : ISessionContext, IScopeDependency
|
|
public class DefaultSessionContext : ISessionContext, IScopeDependency
|
|
{
|
|
{
|
|
- public DefaultSessionContext(IHttpContextAccessor httpContextAccessor, ISugarUnitOfWork<HotlineDbContext> uow)
|
|
|
|
|
|
+ public DefaultSessionContext(IHttpContextAccessor httpContextAccessor)
|
|
{
|
|
{
|
|
var httpContext = httpContextAccessor.HttpContext;
|
|
var httpContext = httpContextAccessor.HttpContext;
|
|
if (httpContext is null)
|
|
if (httpContext is null)
|
|
@@ -30,6 +26,7 @@ namespace Hotline.Api.Token
|
|
OrgId = user.FindFirstValue(AppClaimTypes.DepartmentId);
|
|
OrgId = user.FindFirstValue(AppClaimTypes.DepartmentId);
|
|
OrgCode = user.FindFirstValue(AppClaimTypes.DepartmentCode);
|
|
OrgCode = user.FindFirstValue(AppClaimTypes.DepartmentCode);
|
|
OrgName = user.FindFirstValue(AppClaimTypes.DepartmentName);
|
|
OrgName = user.FindFirstValue(AppClaimTypes.DepartmentName);
|
|
|
|
+ ClientId = user.FindFirstValue(JwtClaimTypes.ClientId);
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -57,5 +54,6 @@ namespace Hotline.Api.Token
|
|
public string? OrgName { get; set; }
|
|
public string? OrgName { get; set; }
|
|
public string RequiredOrgId => OrgId ?? throw new ArgumentNullException();
|
|
public string RequiredOrgId => OrgId ?? throw new ArgumentNullException();
|
|
public string RequiredOrgCode => OrgCode ?? throw new ArgumentNullException();
|
|
public string RequiredOrgCode => OrgCode ?? throw new ArgumentNullException();
|
|
|
|
+ public string? ClientId { get; }
|
|
}
|
|
}
|
|
}
|
|
}
|