Beispiel #1
0
        public Resp_Index <SysUserDTO> Index(Req_Index request)
        {
            var response = new Resp_Index <SysUserDTO>();
            var limits   = _sysRightRepository.GetRightByUserWithModule(request.userId, request.moduleId).ConvertoDto <SysUserRightView, SysModuleOperateIndexDTO>().ToList();

            if (limits.IsNotNull() && limits.Count > 0 && limits.Find(s => s.IsValid == 1).IsNotNull())
            {
                response.allowVisit      = true;
                response.moduleOperaties = limits.OrderByDescending(t => t.IsValid).GroupBy(t => new { t.KeyCode, t.KeyName }).Select(s => new SysModuleOperateIndexDTO
                {
                    KeyCode = s.Key.KeyCode,
                    KeyName = s.Key.KeyName,
                    IsValid = s.Sum(x => x.IsValid),
                }).ToList();
                var query_parameter = new SysUser_Query {
                    PgIndex = 1, PgSize = request.PgSize
                };
                response.query = Query(query_parameter);
            }
            else
            {
                _sysRightRepository.UnitOfWork.Commite();
                response.allowVisit = false;
                response.message    = "无访问权限,请联系管理员";
            }

            return(response);
        }
Beispiel #2
0
 public void Set_Resp_Index(Resp_Index resp_Index)
 {
     this.Resp_Index = resp_Index;
 }