修改用户注册接口

This commit is contained in:
muhua 2024-07-13 16:57:47 +08:00
parent 50e79dd0b9
commit a3f06f2f95
1 changed files with 5 additions and 1 deletions

View File

@ -58,7 +58,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User>
.build();
int insert = baseMapper.insert(user);
if (insert == 1){
return R.ok("注册成功");
Map<String, String> map = new HashMap<>();
map.put("id", user.getId().toString());
String token = JwtUtil.getToken(map, CommonConstant.TOKEN_EXPIRE_TIME);
redisService.hSet(CommonConstant.LOGIN_USER, user.getId().toString(), user, CommonConstant.EXPIRE_TIME);
return R.ok(token);
}
return R.ok("注册失败");
}