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

20200109 完善验证码存储规则

上级 af3e6d89
流水线 #20545 已失败 于阶段
in 0 second
...@@ -136,8 +136,8 @@ public class Test { ...@@ -136,8 +136,8 @@ public class Test {
BaseRequest loginRegister = null; BaseRequest loginRegister = null;
loginRegister = new BaseRequest(); loginRegister = new BaseRequest();
loginRegister.setMobile("13024112081"); loginRegister.setMobile("13024119991");
loginRegister.setAuthCode("163173"); loginRegister.setAuthCode("927566");
String registerString4 = JSONObject.toJSONString(loginRegister); String registerString4 = JSONObject.toJSONString(loginRegister);
//AES CONTENT //AES CONTENT
String contentResult4 = AESUtil.aesEncrypt(registerString4, "YCPQPx4qpQjEjDea"); String contentResult4 = AESUtil.aesEncrypt(registerString4, "YCPQPx4qpQjEjDea");
......
...@@ -151,13 +151,10 @@ public class AutoCodeController extends AccountBaseController { ...@@ -151,13 +151,10 @@ public class AutoCodeController extends AccountBaseController {
String message = "您的验证码是" + authCode + ",在10分钟内有效。如非本人操作,请忽略本短信!"; String message = "您的验证码是" + authCode + ",在10分钟内有效。如非本人操作,请忽略本短信!";
Integer accountIdByMobilePhone = accountService.getAccountIdByMobilePhone(mobilePhone); Integer accountIdByMobilePhone = accountService.getAccountIdByMobilePhone(mobilePhone);
long senderId = accountIdByMobilePhone == null ? 0L : accountIdByMobilePhone; long senderId = accountIdByMobilePhone == null ? 0L : accountIdByMobilePhone;
if(flag==1){ cacheClient.set(this.getAuthCodeKey(mobilePhone, flag.toString()), authCode, 600);
cacheClient.set(RegisterCodeKeyUtils.getRegisterKey(mobilePhone,authCode), mobilePhone, 600); logger.info("验证码缓存信息----->:"+this.getAuthCodeKey(mobilePhone, flag.toString()));
}else{ cacheClient.set(authCodeKeySecure, System.currentTimeMillis(), 60);
cacheClient.set(this.getAuthCodeKey(mobilePhone, flag.toString()), authCode, 600); cacheClient.set(RegisterCodeKeyUtils.getRegisterKey(mobilePhone,authCode), mobilePhone, 600);
logger.info("验证码缓存信息----->:"+this.getAuthCodeKey(mobilePhone, flag.toString()));
cacheClient.set(authCodeKeySecure, System.currentTimeMillis(), 60);
}
super.sendMobileMessage(mobilePhone, message, senderId); super.sendMobileMessage(mobilePhone, message, senderId);
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册