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

获取拼图码时手机入参非空校验.

上级 21623fde
流水线 #23432 已失败 于阶段
in 0 second
...@@ -206,7 +206,8 @@ public class AuthCodeServiceImpl implements AuthCodeService { ...@@ -206,7 +206,8 @@ public class AuthCodeServiceImpl implements AuthCodeService {
Long count = cacheClient.decr(key); Long count = cacheClient.decr(key);
logger.info("validateJigsawCode-count:{}", count); logger.info("validateJigsawCode-count:{}", count);
if (count.equals(99)) { if (count.equals(99)) {
// 本应需要拼图验证,但是在调用获取拼图数据接口时报错了,也直接去发送短信 // a、不需要拼图验证
// b、本应需要拼图验证,但是在调用获取拼图数据接口时报错了,也直接去发送短信
return; return;
} }
} }
...@@ -268,6 +269,7 @@ public class AuthCodeServiceImpl implements AuthCodeService { ...@@ -268,6 +269,7 @@ public class AuthCodeServiceImpl implements AuthCodeService {
// 调用proof服务获取拼图数据 // 调用proof服务获取拼图数据
JigsawCodeModel data = new JigsawCodeModel(); JigsawCodeModel data = new JigsawCodeModel();
PicaResponse picResp = null; PicaResponse picResp = null;
String key = Constants.JIGSAW_CODE_KEY.replace("{mobile}", mobile);
if (need) { if (need) {
try { try {
picResp = sliderImageService.getPic(); picResp = sliderImageService.getPic();
...@@ -275,7 +277,6 @@ public class AuthCodeServiceImpl implements AuthCodeService { ...@@ -275,7 +277,6 @@ public class AuthCodeServiceImpl implements AuthCodeService {
} catch (Exception e) { } catch (Exception e) {
logger.error("getJigsawCode-sliderImageService.getPic invoke exception", e.getMessage()); logger.error("getJigsawCode-sliderImageService.getPic invoke exception", e.getMessage());
// 记录改手机号调用接口获取拼图时接口报错 // 记录改手机号调用接口获取拼图时接口报错
String key = Constants.JIGSAW_CODE_KEY.replace("{mobile}", mobile);
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)) {
...@@ -291,6 +292,10 @@ public class AuthCodeServiceImpl implements AuthCodeService { ...@@ -291,6 +292,10 @@ public class AuthCodeServiceImpl implements AuthCodeService {
data.setyHeight(respData.getInteger("yHeight")); data.setyHeight(respData.getInteger("yHeight"));
} }
} }
} else {
// 不需要拼图验证
logger.info("getJigsawCode-don't need jigsaw code");
cacheClient.set(key, 100, Constants.JIGSAW_CODE_EXPIRE_SECONDS);
} }
return data; return data;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册