fix(系统设置): 修复修改个人信息邮箱时可修改为已存在邮箱的问题
This commit is contained in:
parent
ea3895d315
commit
ab0f3535f8
|
@ -318,6 +318,17 @@ public class UserService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateUser(User user) {
|
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());
|
user.setUpdateTime(System.currentTimeMillis());
|
||||||
userMapper.updateByPrimaryKeySelective(user);
|
userMapper.updateByPrimaryKeySelective(user);
|
||||||
// 禁用用户之后,剔除在线用户
|
// 禁用用户之后,剔除在线用户
|
||||||
|
|
Loading…
Reference in New Issue