From f228d1792d20c313f4d3dc45294902037dd8ac33 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 26 Feb 2020 13:28:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/UserController.java | 13 ++ .../performance/components/router/router.js | 5 + .../components/settings/PersonSetting.vue | 143 ++++++++++++++++++ .../components/settings/SettingMenu.vue | 2 +- 4 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 frontend/src/performance/components/settings/PersonSetting.vue diff --git a/backend/src/main/java/io/metersphere/controller/UserController.java b/backend/src/main/java/io/metersphere/controller/UserController.java index a6ba0788f4..97ea6aa166 100644 --- a/backend/src/main/java/io/metersphere/controller/UserController.java +++ b/backend/src/main/java/io/metersphere/controller/UserController.java @@ -13,7 +13,9 @@ import io.metersphere.controller.request.organization.QueryOrgMemberRequest; import io.metersphere.dto.UserDTO; import io.metersphere.dto.UserRoleDTO; import io.metersphere.service.UserService; +import io.metersphere.user.SessionUser; import io.metersphere.user.SessionUtils; +import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; @@ -51,6 +53,17 @@ public class UserController { userService.updateUser(user); } + /** + * 修改登录用户信息 + */ + @PostMapping("/update/currentuser") + public UserDTO updateCurrentUser(@RequestBody User user) { + SessionUser sessionUser = SessionUtils.getUser(); + BeanUtils.copyProperties(user, sessionUser); + userService.updateUser(user); + return SessionUtils.getUser(); + } + @GetMapping("/role/list/{userId}") public List getUserRolesList(@PathVariable(value = "userId") String userId) { return userService.getUserRolesList(userId); diff --git a/frontend/src/performance/components/router/router.js b/frontend/src/performance/components/router/router.js index 691c201c8f..9d07e29aef 100644 --- a/frontend/src/performance/components/router/router.js +++ b/frontend/src/performance/components/router/router.js @@ -12,6 +12,7 @@ import Member from "../settings/Member"; import TestResourcePool from "../settings/TestResourcePool"; import MsProject from "../project/MsProject"; import OrganizationWorkspace from "../settings/OrganizationWorkspace"; +import PersonSetting from "../settings/PersonSetting"; Vue.use(VueRouter); @@ -58,6 +59,10 @@ const router = new VueRouter({ path: 'organizationworkspace', component: OrganizationWorkspace, }, + { + path: 'personsetting', + component: PersonSetting + }, { path: 'member', component: Member diff --git a/frontend/src/performance/components/settings/PersonSetting.vue b/frontend/src/performance/components/settings/PersonSetting.vue new file mode 100644 index 0000000000..6115744b3c --- /dev/null +++ b/frontend/src/performance/components/settings/PersonSetting.vue @@ -0,0 +1,143 @@ + + + + + diff --git a/frontend/src/performance/components/settings/SettingMenu.vue b/frontend/src/performance/components/settings/SettingMenu.vue index ba126256a9..b390c93bca 100644 --- a/frontend/src/performance/components/settings/SettingMenu.vue +++ b/frontend/src/performance/components/settings/SettingMenu.vue @@ -33,7 +33,7 @@ 个人 - 个人设置 + 个人设置