|
|
using System;
|
using System.Collections.Generic;
|
|
namespace Model
|
{
|
[Serializable]
|
public class SysUser : ISessionObject
|
{
|
public int UserID { get; set; }
|
|
public string Account { get; set; }
|
|
public string Password { get; set; }
|
|
public string Salt { get; set; } //加密盐
|
|
public string UserName { get; set; }
|
|
public DateTime ExpireTime { get; set; }
|
|
public DateTime CreateTime { get; set; }
|
|
public string Remark { get; set; }
|
|
public string Mobile { get; set; }
|
|
public int MobileFlag { get; set; }
|
|
public string Email { get; set; }
|
|
public int EmailFlag { get; set; }
|
|
public string WxData { get; set; }
|
|
public int IsEncryption { get; set; }
|
|
public int IsVerification { get; set; }
|
|
public string ClientIp { get; set; }
|
|
public int Status { get; set; }
|
|
//public int UserType { get; set; } //用户类型,多个时以“,”分隔:1-管理员;2-业务员--全员;3-客户经理;4-客服人员;5-财务人员
|
public string UserType { get; set; } //关联字典数据表的类型为:USER_ROLE。多个角色时以半角“,”分隔。
|
|
public string RoleNames { get; set; } //角色名称:多个角色时以半角“,”分隔。
|
|
public Dictionary<string, SysUserMenu> MenuIDList { get; set; }
|
|
public bool HasRight(string code)
|
{
|
if (this.UserID == 1 && code.StartsWith("104"))
|
return true;
|
if (this.MenuIDList == null)
|
return false;
|
return this.MenuIDList.ContainsKey(code);
|
}
|
|
public bool ContainsTargetID(string menuID, string targetID)
|
{
|
SysUserMenu sysUserMenu;
|
if (this.MenuIDList == null || !this.MenuIDList.TryGetValue(menuID, out sysUserMenu))
|
return false;
|
return sysUserMenu.ContainsTargetID(targetID);
|
}
|
|
public string[] GetSubMenuArray(string menuID)
|
{
|
SysUserMenu sysUserMenu;
|
if (this.MenuIDList == null || !this.MenuIDList.TryGetValue(menuID, out sysUserMenu))
|
return new string[0];
|
return sysUserMenu.SubMenuArray;
|
}
|
}
|
}
|