12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using Hotline.Configurations;
- using XF.Domain.Authentications;
- namespace Hotline.Authentications
- {
- public class ProvinceSessionContext : ISessionContext
- {
- public ProvinceSessionContext(CityProvinceConfiguration config)
- {
- UserId = config.UserId;
- UserName = config.UserName;
- OrgId = config.OrgId;
- OrgName = config.OrgName;
- OrgLevel = 1;
- }
- //取消写入
- /// <summary>
- /// Id of current tenant or null for host
- /// </summary>
- public string? UserId { get; }
- /// <summary>
- /// Id of current user or throw Exception for guest
- /// </summary>
- /// <exception cref="AuthenticationException"></exception>
- public string RequiredUserId => UserId ?? throw new ArgumentNullException();
- //取消写入
- public string? UserName { get; }
- public string? Phone { get; }
- /// <summary>
- /// Roles
- /// </summary>
- public string[] Roles { get; }
- public string? OrgId { get; set; }
- public string RequiredOrgId => OrgId ?? throw new ArgumentNullException();
- 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; }
- public string? ClientId { get; }
- /// <summary>
- /// 工号
- /// </summary>
- public string? StaffNo { get; }
- }
- }
|