修改个人信息

This commit is contained in:
shiziyuan9527 2020-05-09 11:05:03 +08:00
parent 366ae5e95c
commit 0752a0c54b
3 changed files with 5 additions and 4 deletions

View File

@ -118,10 +118,8 @@ public class UserController {
return userService.getUserList();
}
@PostMapping("/update/currentuser")
@PostMapping("/update/current")
public UserDTO updateCurrentUser(@RequestBody User user) {
SessionUser sessionUser = SessionUtils.getUser();
BeanUtils.copyProperties(user, sessionUser);
userService.updateUser(user);
return SessionUtils.getUser();
}

View File

@ -124,6 +124,9 @@ public class UserService {
}
public void updateUser(User user) {
UserDTO userDTO = getUserDTO(user.getId());
BeanUtils.copyProperties(user, userDTO);
SessionUtils.putUser(SessionUser.fromUser(userDTO));
user.setUpdateTime(System.currentTimeMillis());
userMapper.updateByPrimaryKeySelective(user);
}

View File

@ -65,7 +65,7 @@
result: {},
updateVisible: false,
tableData: [],
updatePath: '/user/update/currentuser',
updatePath: '/user/update/current',
form: {},
rule: {
name: [