This commit is contained in:
chenjianxing 2020-05-09 11:36:19 +08:00
commit 18e2cc8960
3 changed files with 5 additions and 4 deletions

View File

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

View File

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

View File

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