Skip to content

Commit

Permalink
更新项目名时没有做名称唯一性校验
Browse files Browse the repository at this point in the history
1更新项目名时没有做名称唯一性校验
2 建议将项目表名称设置为唯一索引
  • Loading branch information
samz406 authored Apr 23, 2019
1 parent 1908e6d commit e8c198c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ public Map<String, Object> update(User loginUser, Integer projectId, String proj
if (checkResult != null) {
return checkResult;
}

Project tempProject = projectMapper.queryByName(projectName);
if (tempProject != null && tempProject.getId() != projectId) {
putMsg(result, Status.PROJECT_ALREADY_EXISTS, projectName);
return result;
}
project.setName(projectName);
project.setDesc(desc);
project.setUpdateTime(new Date());
Expand Down

0 comments on commit e8c198c

Please sign in to comment.