From 0752a0c54b987d38c17dc750a881bacc86b3268f Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Sat, 9 May 2020 11:05:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/controller/UserController.java | 4 +--- backend/src/main/java/io/metersphere/service/UserService.java | 3 +++ .../business/components/settings/personal/PersonSetting.vue | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/controller/UserController.java b/backend/src/main/java/io/metersphere/controller/UserController.java index 5338a0ef39..8c38b04282 100644 --- a/backend/src/main/java/io/metersphere/controller/UserController.java +++ b/backend/src/main/java/io/metersphere/controller/UserController.java @@ -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(); } diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index acb0dcc975..448de856fc 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -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); } diff --git a/frontend/src/business/components/settings/personal/PersonSetting.vue b/frontend/src/business/components/settings/personal/PersonSetting.vue index 62df4fb731..10e7187e74 100644 --- a/frontend/src/business/components/settings/personal/PersonSetting.vue +++ b/frontend/src/business/components/settings/personal/PersonSetting.vue @@ -65,7 +65,7 @@ result: {}, updateVisible: false, tableData: [], - updatePath: '/user/update/currentuser', + updatePath: '/user/update/current', form: {}, rule: { name: [