|
@@ -70,6 +70,8 @@ public class ContentPlatformAccountServiceImpl implements ContentPlatformAccount
|
|
|
if (verifyCode.getStatus() == 1) {
|
|
|
throw new CommonException(ExceptionEnum.EMAIL_VERIFY_CODE_USED);
|
|
|
}
|
|
|
+ verifyCode.setStatus(1);
|
|
|
+ verifyCodeMapper.updateByPrimaryKey(verifyCode);
|
|
|
}
|
|
|
String token = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
|
@@ -95,12 +97,15 @@ public class ContentPlatformAccountServiceImpl implements ContentPlatformAccount
|
|
|
}
|
|
|
|
|
|
private void saveTokenToRedis(AccountLoginVO loginInfo, String oldToken, String token) {
|
|
|
+ String tokenPrefix = "login.{token}";
|
|
|
// 清除老token
|
|
|
- String info = redisUtils.getString(JwtInterceptor.TOKEN_PREFIX.replace("{token}", oldToken));
|
|
|
- if (StringUtils.hasText(info)) {
|
|
|
- redisUtils.del(JwtInterceptor.TOKEN_PREFIX.replace("{token}", oldToken));
|
|
|
+ if (StringUtils.hasText(oldToken)) {
|
|
|
+ String info = redisUtils.getString(tokenPrefix.replace("{token}", oldToken));
|
|
|
+ if (StringUtils.hasText(info)) {
|
|
|
+ redisUtils.del(tokenPrefix.replace("{token}", oldToken));
|
|
|
+ }
|
|
|
}
|
|
|
- String redisKey = JwtInterceptor.TOKEN_PREFIX.replace("{token}", token);
|
|
|
+ String redisKey = tokenPrefix.replace("{token}", token);
|
|
|
redisUtils.setValueWithExpire(redisKey, JSON.toJSONString(loginInfo), 7 * 24 * 60 * 60L);
|
|
|
}
|
|
|
|