1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
 
 
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-客服人员;6-财务人员;99-其他
 
        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;
        }
    }
}