🐛 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
public R<Boolean> userUpdate(@RequestBody UserDTO userDto) {
SysUser user = userService.selectById(userDto.getUserId());
return new R<>(userService.updateUser(userDto, user.getUsername()));
return new R<>(userService.updateUser(userDto));
}
/**

View File

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