Merge pull request #3280 from dataease/pr@dev@fix_scan_qr_login

fix(登录): 第三方平台扫码登录在姓名或邮箱重复情况下依然可以成功
This commit is contained in:
xuwei-fit2cloud 2022-09-30 16:08:51 +08:00 committed by GitHub
commit 8645213b94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -454,6 +454,7 @@ public class SysUserService {
if (StringUtils.isNotBlank(userName)) {
example.createCriteria().andUsernameEqualTo(userName);
List<SysUser> users = sysUserMapper.selectByExample(example);
example.clear();
if (CollectionUtils.isNotEmpty(users)) {
throw new RuntimeException("用户ID【" + userName + "】已存在,请联系管理员");
}
@ -462,14 +463,16 @@ public class SysUserService {
if (StringUtils.isNotBlank(nickName)) {
example.createCriteria().andNickNameEqualTo(nickName);
List<SysUser> users = sysUserMapper.selectByExample(example);
example.clear();
if (CollectionUtils.isNotEmpty(users)) {
throw new RuntimeException("用户姓名【" + nickName + "】已存在,请联系管理员");
}
}
example.clear();
if (StringUtils.isNotBlank(email)) {
example.createCriteria().andEmailEqualTo(email);
List<SysUser> users = sysUserMapper.selectByExample(example);
example.clear();
if (CollectionUtils.isNotEmpty(users)) {
throw new RuntimeException("用户邮箱【" + email + "】已存在,请联系管理员");
}