提交 8b4a5bcf 编写于 作者: Chongwen.jiang's avatar Chongwen.jiang

解决调用风控记录数据重复问题

上级 0da6cbe3
流水线 #23627 已失败 于阶段
in 0 second
...@@ -216,8 +216,7 @@ public class AuthCodeServiceImpl implements AuthCodeService { ...@@ -216,8 +216,7 @@ public class AuthCodeServiceImpl implements AuthCodeService {
if (StringUtils.isEmpty(capCode) || xPos <= 0) { if (StringUtils.isEmpty(capCode) || xPos <= 0) {
String key = Constants.JIGSAW_CODE_KEY.replace("{mobile}", paramReq.getMobile()); String key = Constants.JIGSAW_CODE_KEY.replace("{mobile}", paramReq.getMobile());
Long count = cacheClient.decr(key); Long count = cacheClient.decr(key);
logger.info("validateJigsawCode-count:{}", count); if (count != null && count.intValue() == 99) {
if (count.equals(99)) {
// a、不需要拼图验证,可直接去发送短信 // a、不需要拼图验证,可直接去发送短信
// b、本应需要拼图验证,但是在调用获取拼图数据接口时报错了,也直接去发送短信 // b、本应需要拼图验证,但是在调用获取拼图数据接口时报错了,也直接去发送短信
return needCheck; return needCheck;
...@@ -289,12 +288,13 @@ public class AuthCodeServiceImpl implements AuthCodeService { ...@@ -289,12 +288,13 @@ public class AuthCodeServiceImpl implements AuthCodeService {
logger.info("getJigsawCode-getPic-code:{}", picResp.getCode()); logger.info("getJigsawCode-getPic-code:{}", picResp.getCode());
} catch (Exception e) { } catch (Exception e) {
logger.error("getJigsawCode-sliderImageService.getPic invoke exception", e.getMessage()); logger.error("getJigsawCode-sliderImageService.getPic invoke exception", e.getMessage());
// 记录手机号调用接口获取拼图时接口报错 // 记录手机号调用接口获取拼图时接口报错
cacheClient.set(key, 100, Constants.JIGSAW_CODE_EXPIRE_SECONDS); cacheClient.set(key, 100, Constants.JIGSAW_CODE_EXPIRE_SECONDS);
} }
if (Objects.nonNull(picResp)) { if (Objects.nonNull(picResp)) {
if (!PicaResultCode.SUCCESS.code().equals(picResp.getCode())) { if (!PicaResultCode.SUCCESS.code().equals(picResp.getCode())) {
logger.info("getJigsawCode-getPic-code exception"); logger.info("getJigsawCode-getPic-code exception");
cacheClient.set(key, 100, Constants.JIGSAW_CODE_EXPIRE_SECONDS);
} }
JSONObject respData = JSON.parseObject(JSON.toJSONString(picResp.getData()), JSONObject.class); JSONObject respData = JSON.parseObject(JSON.toJSONString(picResp.getData()), JSONObject.class);
if (Objects.nonNull(respData)) { if (Objects.nonNull(respData)) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册