diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index 6a20ed42c3..ebb1c99ead 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -318,6 +318,17 @@ public class UserService { } public void updateUser(User user) { + // todo 提取重复代码 + if (StringUtils.isNotBlank(user.getEmail())) { + UserExample example = new UserExample(); + UserExample.Criteria criteria = example.createCriteria(); + criteria.andEmailEqualTo(user.getEmail()); + criteria.andIdNotEqualTo(user.getId()); + if (userMapper.countByExample(example) > 0) { + MSException.throwException(Translator.get("user_email_already_exists")); + } + } + user.setUpdateTime(System.currentTimeMillis()); userMapper.updateByPrimaryKeySelective(user); // 禁用用户之后,剔除在线用户 diff --git a/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue b/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue index 5d979498d4..9f7b8bfa66 100644 --- a/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue +++ b/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue @@ -293,6 +293,8 @@ this.projectId = data[0].id; this.projectName = data[0].name; this.search(); + // 获取项目时刷新该项目模块 + this.getProjectNode(this.projectId) } }) }