示例#1
0
        /// <summary>
        /// 获取包含权限URL的当前登录系统用户
        /// </summary>
        /// <returns></returns>
        public User_Info GetLoginUser()
        {
            LoginUser.PermissionUrl = WebCache.GetPermissionUrlCache(LoginUser);
            if (LoginUser.PermissionUrl == null)
            {
                //查出用户所属角色的权限
                var role = new RoleBLL().GetModel(i => i.ID == LoginUser.RoleID);

                if (role != null)
                {
                    LoginUser.PermissionUrl = new ResourceBLL().GetPermissionURL(role.ResourceID);
                }

                LoginUser.PermissionUrl = LoginUser.PermissionUrl ?? "";

                //将url权限字符串加入到缓存中
                WebCache.SetPermissionUrlCache(LoginUser, LoginUser.PermissionUrl);
            }
            return(LoginUser);
        }