|
@@ -1,10 +1,13 @@
|
|
|
using Hotline.Configurations;
|
|
|
+using Microsoft.Extensions.Options;
|
|
|
using XF.Domain.Authentications;
|
|
|
|
|
|
namespace Hotline.Authentications
|
|
|
{
|
|
|
public class ProvinceSessionContext : ISessionContext
|
|
|
{
|
|
|
+ public const string Key = "ProvinceSessionContext";
|
|
|
+
|
|
|
public ProvinceSessionContext(CityProvinceConfiguration config)
|
|
|
{
|
|
|
UserId = config.UserId;
|
|
@@ -26,7 +29,7 @@ namespace Hotline.Authentications
|
|
|
/// <exception cref="AuthenticationException"></exception>
|
|
|
public string RequiredUserId => UserId ?? throw new ArgumentNullException();
|
|
|
//取消写入
|
|
|
- public string? UserName { get; set; }
|
|
|
+ public string? UserName { get; set; }
|
|
|
public string? Phone { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -52,4 +55,50 @@ namespace Hotline.Authentications
|
|
|
/// </summary>
|
|
|
public string? StaffNo { get; set; }
|
|
|
}
|
|
|
+
|
|
|
+ public class TestSessionContext : ISessionContext
|
|
|
+ {
|
|
|
+ public const string Key = "TestSessionContext";
|
|
|
+
|
|
|
+ public TestSessionContext(IOptions<CityBaseConfiguration> options)
|
|
|
+ {
|
|
|
+ UserId = options.Value.CityProvince.UserId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Id of current tenant or null for host
|
|
|
+ /// </summary>
|
|
|
+ public string? UserId { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Id of current user or throw Exception for guest
|
|
|
+ /// </summary>
|
|
|
+ /// <exception cref="AuthenticationException"></exception>
|
|
|
+ public string RequiredUserId { get; }
|
|
|
+ public string? UserName { get; set; }
|
|
|
+ public string? Phone { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Roles
|
|
|
+ /// </summary>
|
|
|
+ public string[] Roles { get; set; }
|
|
|
+ public string? OrgId { get; set; }
|
|
|
+ public string RequiredOrgId { get; }
|
|
|
+ public string? OrgName { get; set; }
|
|
|
+ public int OrgLevel { get; set; }
|
|
|
+ public string? OrgAreaCode { get; set; }
|
|
|
+ public bool OrgIsCenter { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 部门行政区划名称
|
|
|
+ /// </summary>
|
|
|
+ public string? OrgAreaName { get; set; }
|
|
|
+ public string? AreaId { get; set; }
|
|
|
+ public string? ClientId { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工号
|
|
|
+ /// </summary>
|
|
|
+ public string? StaffNo { get; set; }
|
|
|
+ }
|
|
|
}
|