public IActionResult AddParent(MenuDto menuDto) { if (ModelState.IsValid) { //获取当前创建时间和创建人 menuDto.CreateTime = DateTime.Now.ToString(); menuDto.CreateUser = HttpContext.Session.GetString("CurrentUser"); _menuAppService.AddDto(menuDto); return(RedirectToAction("Index", "Menu")); } GenerateViewDatas(); return(View(menuDto)); }