public async Task <IActionResult> OnGetFunctionListAsync(long RoleId, long?pid) { //取得角色所有功能列表 var RoleFunctions = await _service3.GetListAsync(new RoleFunctionSearch { RoleId = RoleId }, null); var functions = await _service2.GetSubsAsync(pid); foreach (var item in functions) { if (RoleFunctions.Any(x => x.FunctionId == item.Id)) { item.IsRoleHasAuth = true; } else { item.IsRoleHasAuth = false; } } return(JsonData(functions)); }