public async Task <MessageModel <string> > UpdateUser([FromBody] SysUser sysUser) { var data = new MessageModel <string>(); data.success = await _userserver.UpdateUser(sysUser); if (data.success) { data.msg = "用户修改成功"; } return(data); }
public ActionResult UserEdit(UserEntity model) { if (model == null) { return(RedirectToAction("UserList")); } UserEntity entity = _userService.GetUserById(model.Id); if (entity != null) { entity.UserName = model.UserName; entity.Password = model.Password; _userService.UpdateUser(entity); } return(RedirectToAction("UserList")); }