修改手机号重复问题
This commit is contained in:
parent
d09c644c6b
commit
13b0f2c9de
|
|
@ -189,6 +189,17 @@ public class UserServiceImpl implements IUserService {
|
|||
if (!Pattern.matches("^[1][3-9][0-9]{9}$", value)) {
|
||||
throw new OperateException("手机号格式不正确!");
|
||||
}
|
||||
|
||||
User tempUser = userMapper.selectOne(new QueryWrapper<User>()
|
||||
.select("id,account,mobile")
|
||||
.eq("mobile", value)
|
||||
.isNull("delete_time")
|
||||
.last("limit 1"));
|
||||
|
||||
if (StringUtils.isNotNull(tempUser) && user.getId().equals(id)) {
|
||||
throw new OperateException("手机号已被其它账号绑定!");
|
||||
}
|
||||
|
||||
user.setMobile(value);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in New Issue