提交 042e186a 编写于 作者: minghao.wu's avatar minghao.wu

Merge branch 'dev-hotfix-0826' into 'release'

Dev hotfix 0826



See merge request !45
流水线 #29527 已失败 于阶段
in 0 second
...@@ -83,8 +83,9 @@ public class RegisterServiceImpl implements RegisterService { ...@@ -83,8 +83,9 @@ public class RegisterServiceImpl implements RegisterService {
//对注册接口做幂等性处理:注册成功,删除缓存,注册失败提示用户 //对注册接口做幂等性处理:注册成功,删除缓存,注册失败提示用户
String nxKey = Constants.REPEAT_REGISTER_PREFIX + mobile; String nxKey = Constants.REPEAT_REGISTER_PREFIX + mobile;
Long resultNx = redisClient.setnx(nxKey, mobile); Long resultNx = redisClient.setnx(nxKey, mobile);
redisClient.expire(nxKey, 2);
if(resultNx == 1) { if(resultNx == 1) {
try { //try {
String mobileEncrypt = AESUtil.encryptV0(mobile); String mobileEncrypt = AESUtil.encryptV0(mobile);
AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobileEncrypt); AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobileEncrypt);
if (accountInfoEntity == null) { if (accountInfoEntity == null) {
...@@ -161,17 +162,17 @@ public class RegisterServiceImpl implements RegisterService { ...@@ -161,17 +162,17 @@ public class RegisterServiceImpl implements RegisterService {
throw new AccountException(AccountExceptionEnum.PICA_ALREADY_REGISTER); throw new AccountException(AccountExceptionEnum.PICA_ALREADY_REGISTER);
} }
} catch (Exception e) { //} catch (Exception e) {
//向上抛出异常,让异常处理框架捕获到 //向上抛出异常,让异常处理框架捕获到
logger.error("registerException-" + e.getMessage(), e); //logger.error("registerException-" + e.getMessage(), e);
intactUtil.sendIntact(batchNo,"register",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"注册失败"); //intactUtil.sendIntact(batchNo,"register",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"注册失败");
throw new AccountException(AccountExceptionEnum.PICA_REGISTER_FAIL); //throw new AccountException(AccountExceptionEnum.PICA_REGISTER_FAIL);
} finally { //} finally {
//如果在注册过程中抛出异常,就删除redis中的注册标记 //如果在注册过程中抛出异常,就删除redis中的注册标记
logger.info("register-finally-del-nxKey"); //logger.info("register-finally-del-nxKey");
redisClient.del(nxKey); //redisClient.del(nxKey);
} //}
} else { } else {
logger.info("register-nxKey is exists"); logger.info("register-nxKey is exists");
intactUtil.sendIntact(batchNo,"register",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"该手机号已注册,请直接登录"); intactUtil.sendIntact(batchNo,"register",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"该手机号已注册,请直接登录");
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册