提交 9445ca36 编写于 作者: rushui.chen's avatar rushui.chen

20200110 完善验证码的删除逻辑

上级 c15ebeb5
流水线 #20580 已失败 于阶段
in 0 second
......@@ -154,6 +154,7 @@ public class AutoCodeController extends AccountBaseController {
cacheClient.set(this.getAuthCodeKey(mobilePhone, flag.toString()), authCode, 600);
logger.info("验证码缓存信息----->:"+this.getAuthCodeKey(mobilePhone, flag.toString()));
cacheClient.set(authCodeKeySecure, System.currentTimeMillis(), 60);
//处理验证码原子性的问题
cacheClient.set(RegisterCodeKeyUtils.getRegisterKey(mobilePhone,authCode), mobilePhone, 600);
super.sendMobileMessage(mobilePhone, message, senderId);
}
......
......@@ -115,9 +115,11 @@ public class AccountUtils {
}
String flag = org.apache.commons.lang.StringUtils.isBlank(type) ? "0" : type;
if (org.apache.commons.lang.StringUtils.isBlank(sysCode)) {
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "短信验证码错误");
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "短信验证码为空");
}
//获取验证码的key
String authCodeKey = RegisterCodeKeyUtils.getRegisterKey(mobile, sysCode);
//从redis中删除短信验证码,如果能够删除成功,说明验证码正确
Long num = cacheClient.del(authCodeKey);
logger.info("key"+authCodeKey);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册