|
|
@@ -595,27 +595,32 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
}
|
|
|
//迪士尼
|
|
|
if (goodsId == 3) {
|
|
|
- code = StrUtil.subWithLength(body, body.indexOf(" 15 "), 215);
|
|
|
+ int index = body.indexOf("otp_code");
|
|
|
+ if (index == -1) {
|
|
|
+ index = body.indexOf(" 15 ");
|
|
|
+ }
|
|
|
+ code = StrUtil.subWithLength(body, index, 215);
|
|
|
}
|
|
|
//PS
|
|
|
if (goodsId == 33l) {
|
|
|
code = StrUtil.subWithLength(body, body.indexOf("ADOBE"), 215);
|
|
|
}
|
|
|
+ code = getVerifyCode(code);
|
|
|
+ if (!Validator.isNumber(code)) {
|
|
|
+ log.error("获取账号验证码失败:{}", StrUtil.subSufByLength(code, 512));
|
|
|
+ throw BusinessRuntimeException.getInstance("获取验证码失败,请重新获取...");
|
|
|
+ }
|
|
|
+ return code.trim();
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getVerifyCode(String code) {
|
|
|
if (StrUtil.isNotEmpty(code)) {
|
|
|
Pattern pattern = Pattern.compile("\\d{6}");
|
|
|
Matcher matcher = pattern.matcher(code);
|
|
|
while (matcher.find()) {
|
|
|
- code = matcher.group();
|
|
|
- break;
|
|
|
+ return matcher.group();
|
|
|
}
|
|
|
}
|
|
|
- if (!Validator.isNumber(code)) {
|
|
|
- throw BusinessRuntimeException.getInstance("获取验证码失败,请重新获取");
|
|
|
- }
|
|
|
- if (StrUtil.isEmpty(code)) {
|
|
|
- log.error("获取账号验证码失败:{}", StrUtil.subSufByLength(code, 512));
|
|
|
- throw BusinessRuntimeException.getInstance("获取验证码失败,请重新获取...");
|
|
|
- }
|
|
|
- return code.trim();
|
|
|
+ return StrUtil.EMPTY;
|
|
|
}
|
|
|
}
|