|
@@ -84,18 +84,20 @@ public class CommonMailServiceImpl implements CommonMailService {
|
|
|
//Adobe 获取验证码
|
|
//Adobe 获取验证码
|
|
|
if (goodsId == Constant.ADOBE_GOODS_ID) {
|
|
if (goodsId == Constant.ADOBE_GOODS_ID) {
|
|
|
try {
|
|
try {
|
|
|
- String url = "http://www.yxiang6.com/api/GetLastEmails?email=%s&boxType=1&num=5" + account;
|
|
|
|
|
|
|
+ String url = String.format("http://www.yxiang6.com/api/GetLastEmails?email=%s&boxType=1&num=2", account);
|
|
|
HttpRequest post = HttpUtil.createGet(url).header("x-admin-auth", "xin456");
|
|
HttpRequest post = HttpUtil.createGet(url).header("x-admin-auth", "xin456");
|
|
|
HttpResponse execute = post.execute();
|
|
HttpResponse execute = post.execute();
|
|
|
JSONObject resp = Jsons.parseObject(execute.body(), JSONObject.class);
|
|
JSONObject resp = Jsons.parseObject(execute.body(), JSONObject.class);
|
|
|
- List<AdobeEmailResp> AdobeEmailResps = Jsons.parseList(resp.getObj("results"), AdobeEmailResp.class);
|
|
|
|
|
|
|
+ List<AdobeEmailResp> AdobeEmailResps = Jsons.parseList(resp.getObj("data"), AdobeEmailResp.class);
|
|
|
if (CollUtil.isNotEmpty(AdobeEmailResps)) {
|
|
if (CollUtil.isNotEmpty(AdobeEmailResps)) {
|
|
|
for (AdobeEmailResp adobeEmailResp : AdobeEmailResps) {
|
|
for (AdobeEmailResp adobeEmailResp : AdobeEmailResps) {
|
|
|
String str = "Your verification code is";
|
|
String str = "Your verification code is";
|
|
|
- if (StrUtil.equals(adobeEmailResp.getAddress(), account) && StrUtil.isNotBlank(adobeEmailResp.getRaw()) && adobeEmailResp.getRaw().contains(str)) {
|
|
|
|
|
- String code = StrUtil.subAfter(adobeEmailResp.getRaw(), str, false);
|
|
|
|
|
- return StringUtil.getVerifyCodePattern(code, 6);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ String body = adobeEmailResp.getBody();
|
|
|
|
|
+ if (adobeEmailResp.getTo().contains(account) && StrUtil.isNotBlank(body) && body.contains(str)) {
|
|
|
|
|
+ String code = StrUtil.subAfter(body, str, false);
|
|
|
|
|
+ code = code.replaceAll("<[^>]*>", " ");
|
|
|
|
|
+ return StringUtil.getVerifyCodePattern(code, 6);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|