//获取模型当前的ViewToken public IActionResult Index(int?type, int pageSize = 20, int pageIndex = 1) { var ip = NetWork.GetInternalIP(); ViewBag.Ip = ip.ToString(); int?_type = type == null ? 2 : type; List <ViewTokens> viewTokens = null; int?pageTotal = jobContext.Set <ViewTokens>()?.Count(item => item.IsActive); switch (_type) { case 0: viewTokens = jobContext.Set <ViewTokens>().Where(item => !item.IsDemo && item.IsActive)?.Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList(); break; case 1: viewTokens = jobContext.Set <ViewTokens>().Where(item => item.IsDemo && item.IsActive)?.Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList(); break; case 2: viewTokens = jobContext.Set <ViewTokens>().Where(item => item.IsActive)?.Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList(); break; default: break; } return(View(viewTokens)); }