修改用户注册接口

This commit is contained in:
muhua 2024-07-13 17:06:13 +08:00
parent a3f06f2f95
commit 764a788671
1 changed files with 22 additions and 18 deletions

View File

@ -46,6 +46,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User>
@Override
public R<String> register(UserRegisterDTO userRegisterDTO) {
try {
if (checkUser(userRegisterDTO)) {
return R.fail("用户已被注册");
}
@ -64,7 +65,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User>
redisService.hSet(CommonConstant.LOGIN_USER, user.getId().toString(), user, CommonConstant.EXPIRE_TIME);
return R.ok(token);
}
return R.ok("注册失败");
} catch (Exception e){
e.printStackTrace();
}
return null;
}
@Override