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

20200109 验证码的key不使用flag

上级 b17bb585
流水线 #20533 已失败 于阶段
in 0 second
...@@ -152,7 +152,7 @@ public class AutoCodeController extends AccountBaseController { ...@@ -152,7 +152,7 @@ public class AutoCodeController extends AccountBaseController {
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){ if(flag==1){
cacheClient.set(RegisterCodeKeyUtils.getRegisterKey(mobilePhone, flag.toString(),authCode), mobilePhone, 600); cacheClient.set(RegisterCodeKeyUtils.getRegisterKey(mobilePhone,authCode), mobilePhone, 600);
}else{ }else{
cacheClient.set(this.getAuthCodeKey(mobilePhone, flag.toString()), authCode, 600); cacheClient.set(this.getAuthCodeKey(mobilePhone, flag.toString()), authCode, 600);
logger.info("验证码缓存信息----->:"+this.getAuthCodeKey(mobilePhone, flag.toString())); logger.info("验证码缓存信息----->:"+this.getAuthCodeKey(mobilePhone, flag.toString()));
......
...@@ -117,7 +117,7 @@ public class AccountUtils { ...@@ -117,7 +117,7 @@ public class AccountUtils {
if (org.apache.commons.lang.StringUtils.isBlank(sysCode)) { if (org.apache.commons.lang.StringUtils.isBlank(sysCode)) {
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "短信验证码错误"); throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "短信验证码错误");
} }
String authCodeKey = RegisterCodeKeyUtils.getRegisterKey(mobile, flag, sysCode); String authCodeKey = RegisterCodeKeyUtils.getRegisterKey(mobile, sysCode);
//从redis中删除短信验证码,如果能够删除成功,说明验证码正确 //从redis中删除短信验证码,如果能够删除成功,说明验证码正确
Long num = cacheClient.del(authCodeKey); Long num = cacheClient.del(authCodeKey);
logger.info("key"+authCodeKey); logger.info("key"+authCodeKey);
......
...@@ -13,12 +13,11 @@ public class RegisterCodeKeyUtils { ...@@ -13,12 +13,11 @@ public class RegisterCodeKeyUtils {
* 获取注册验证码的key * 获取注册验证码的key
* *
* @param mobilePhone * @param mobilePhone
* @param flag
* @param authCode * @param authCode
* @return * @return
*/ */
public static String getRegisterKey(String mobilePhone, String flag, String authCode) { public static String getRegisterKey(String mobilePhone, String authCode) {
return AUTH_CODE_PREFIX + flag + "-" + AESUtil.encryptV0(mobilePhone) + authCode; return AUTH_CODE_PREFIX + AESUtil.encryptV0(mobilePhone) + authCode;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册