🐛 Fixing a bug. fix #IOWMD

This commit is contained in:
冷冷 2018-11-21 20:45:06 +08:00
parent 3a0f0f1656
commit 86d9885259
2 changed files with 5 additions and 6 deletions

View File

@ -130,8 +130,7 @@ public class UserController extends BaseController {
*/ */
@PutMapping @PutMapping
public R<Boolean> userUpdate(@RequestBody UserDTO userDto) { public R<Boolean> userUpdate(@RequestBody UserDTO userDto) {
SysUser user = userService.selectById(userDto.getUserId()); return new R<>(userService.updateUser(userDto));
return new R<>(userService.updateUser(userDto, user.getUsername()));
} }
/** /**
@ -175,8 +174,8 @@ public class UserController extends BaseController {
* @return 用户集合 * @return 用户集合
*/ */
@RequestMapping("/userPage") @RequestMapping("/userPage")
public Page userPage(@RequestParam Map<String, Object> params,UserVO userVO) { public Page userPage(@RequestParam Map<String, Object> params, UserVO userVO) {
return userService.selectWithRolePage(new Query(params),userVO); return userService.selectWithRolePage(new Query(params), userVO);
} }
/** /**

View File

@ -250,8 +250,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
} }
@Override @Override
@CacheEvict(value = "user_details", key = "#username") @CacheEvict(value = "user_details", key = "#userDto.username")
public Boolean updateUser(UserDTO userDto, String username) { public Boolean updateUser(UserDTO userDto) {
SysUser sysUser = new SysUser(); SysUser sysUser = new SysUser();
BeanUtils.copyProperties(userDto, sysUser); BeanUtils.copyProperties(userDto, sysUser);
sysUser.setUpdateTime(new Date()); sysUser.setUpdateTime(new Date());