Commit b38948a2 authored by 唐峰's avatar 唐峰

登录获取极验异常时的NPE处理

parent b5711d5c
......@@ -14,6 +14,7 @@ import cn.quantgroup.xyqb.service.captcha.IGeetestCaptchaService;
import cn.quantgroup.xyqb.service.captcha.IGeetestLogService;
import cn.quantgroup.xyqb.service.captcha.IQuantgroupCaptchaService;
import cn.quantgroup.xyqb.util.PasswordUtil;
import com.google.common.collect.Maps;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
......@@ -63,7 +64,6 @@ public class GeetestBehaviorStrategy implements BehaviorStrategy {
return (boolean) result.get("valid");
}
@Override
public BehaviorCodeBean generate(BehaviorReq behaviorReq) {
BehaviorCodeBean behaviorCodeBean = new BehaviorCodeBean();
......@@ -83,6 +83,8 @@ public class GeetestBehaviorStrategy implements BehaviorStrategy {
imgMap = geetestCaptchaService.fetchGeetestCaptcha(PasswordUtil.MD5(key), behaviorReq.getIp(), ClientType.valueByCode(behaviorReq.getClientType()));
}
imgMap = imgMap == null ? Maps.newHashMap() : imgMap;
if (imgMap.containsKey("success") && "1".equals(imgMap.get("success"))) {
behaviorCodeBean.setType(1);
behaviorCodeBean.setGeetestCode(BehaviorCodeBean.GeetestCode.builder().gt(imgMap.get("gt"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment