校验用户昵称

This commit is contained in:
x ronger 2019-12-05 20:24:09 +08:00
parent d686a68afa
commit 1f1ce5b4c1

View File

@ -81,7 +81,8 @@ public class UserServiceImpl extends AbstractService<User> implements UserServic
private String checkNickname(String nickname) {
Integer result = userMapper.selectCountByNickName(nickname);
if (result > 0) {
return checkNickname(nickname + System.currentTimeMillis());
StringBuilder stringBuilder = new StringBuilder(nickname);
return checkNickname(stringBuilder.append("_").append(System.currentTimeMillis()).toString());
}
return nickname;
}