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

发送验证码加入非空判断

上级 58a3164d
流水线 #23850 已失败 于阶段
in 0 second
......@@ -132,7 +132,9 @@ public class AutoCodeController extends AccountBaseController {
// 验证码类型 0默认 1注册 2微信登录绑定手机 3修改手机
// 4重置密码 5忘记密码 7患者招募提交问卷(效验) 8Appe登录绑定手机
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
request.setSourceType(super.getSourceType());
if (super.getSourceType() != null) {
request.setSourceType(super.getSourceType());
}
AccountUtils.checkMobilePhone(request.getMobile());
// 拼图验证
......@@ -162,7 +164,9 @@ public class AutoCodeController extends AccountBaseController {
public PicaResponse<String> getAuthCodeWithCaptcha(@RequestBody EncryptEntity entity,
HttpServletRequest req) throws Exception {
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
request.setSourceType(super.getSourceType());
if (super.getSourceType() != null) {
request.setSourceType(super.getSourceType());
}
String mobilePhone = request.getMobile();
String flag = request.getFlag() + "";
String captchaToken = request.getCaptchaToken();
......
......@@ -49,9 +49,9 @@ public class BaseRequest {
@ApiModelProperty("capCode")
private String capCode;
@ApiModelProperty("滑动图片的x位置")
private int xPos;
private Integer xPos;
@ApiModelProperty("h5端适配缩放后背景图实际宽度")
private int imageW;
private Integer imageW;
public String getCaptchaToken() {
return captchaToken;
......@@ -221,19 +221,19 @@ public class BaseRequest {
this.capCode = capCode;
}
public int getxPos() {
public Integer getxPos() {
return xPos;
}
public void setxPos(int xPos) {
public void setxPos(Integer xPos) {
this.xPos = xPos;
}
public int getImageW() {
public Integer getImageW() {
return imageW;
}
public void setImageW(int imageW) {
public void setImageW(Integer imageW) {
this.imageW = imageW;
}
}
......@@ -13,7 +13,7 @@ public class OneClickLoginReq {
private String loginIp;
private int productType;
private Integer productType = 0;
public String getLoginIp() {
return loginIp;
......@@ -23,11 +23,11 @@ public class OneClickLoginReq {
this.loginIp = loginIp;
}
public int getProductType() {
public Integer getProductType() {
return productType;
}
public void setProductType(int productType) {
public void setProductType(Integer productType) {
this.productType = productType;
}
......
......@@ -232,7 +232,7 @@ public class AuthCodeServiceImpl implements AuthCodeService {
return -1;
}
String capCode = paramReq.getCapCode();
int xPos = paramReq.getxPos();
int xPos = paramReq.getxPos() == null ? 0 : paramReq.getxPos();
if (StringUtils.isEmpty(capCode) || xPos <= 0) {
String key = Constants.JIGSAW_CODE_KEY.replace("{mobile}", paramReq.getMobile());
Long count = cacheClient.decr(key);
......@@ -249,7 +249,7 @@ public class AuthCodeServiceImpl implements AuthCodeService {
SliderImageRequest req = new SliderImageRequest();
req.setCapcode(capCode);
req.setXpos(xPos);
req.setClientBackImageWidth(paramReq.getImageW());
req.setClientBackImageWidth(paramReq.getImageW() == null ? 1 : paramReq.getImageW());
resp = sliderImageService.checkcapcode(req);
logger.info("validateJigsawCode-resp:{}", JSON.toJSONString(resp));
} catch (Exception e) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册