|
@@ -35,24 +35,26 @@ public class CommonMailServiceImpl implements CommonMailService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String getTicketMailCode(Long goodsId, String account, String relateEmail, String emailPwd, Date emailCreatedTime, Integer type, Integer linkType, Boolean isReturnDeviceUrl) throws Exception {
|
|
public String getTicketMailCode(Long goodsId, String account, String relateEmail, String emailPwd, Date emailCreatedTime, Integer type, Integer linkType, Boolean isReturnDeviceUrl) throws Exception {
|
|
|
- //25年的GPT账号获取验证码 特殊处理
|
|
|
|
|
- //获取失败走下一步
|
|
|
|
|
- if (goodsId == 18 && emailCreatedTime.compareTo(DateUtil.parse("2025-01-01")) > 0) {
|
|
|
|
|
- try {
|
|
|
|
|
- //获取近十封邮件
|
|
|
|
|
- String url = "https://ms.lqqq.cc/" + account + "----" + emailPwd;
|
|
|
|
|
- HttpRequest post = HttpUtil.createGet(url);
|
|
|
|
|
- HttpResponse execute = post.execute();
|
|
|
|
|
- List<JSONObject> jsonObjects = Jsons.parseList(execute.body(), JSONObject.class);
|
|
|
|
|
- for (JSONObject jsonObject : jsonObjects) {
|
|
|
|
|
- String str = jsonObject.getStr("content");
|
|
|
|
|
- if (str.contains("Your ChatGPT code is")) {
|
|
|
|
|
- String code = TicketCodeCommonUtil.getTicketCodeStr(str, goodsId);
|
|
|
|
|
- return code;
|
|
|
|
|
|
|
+ if (StrUtil.isEmpty(relateEmail)) {
|
|
|
|
|
+ //25年的GPT账号获取验证码 特殊处理
|
|
|
|
|
+ //获取失败走下一步
|
|
|
|
|
+ if (goodsId == 18 && emailCreatedTime.compareTo(DateUtil.parse("2025-01-01")) > 0) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ //获取近十封邮件
|
|
|
|
|
+ String url = "https://ms.lqqq.cc/" + account + "----" + emailPwd;
|
|
|
|
|
+ HttpRequest post = HttpUtil.createGet(url);
|
|
|
|
|
+ HttpResponse execute = post.execute();
|
|
|
|
|
+ List<JSONObject> jsonObjects = Jsons.parseList(execute.body(), JSONObject.class);
|
|
|
|
|
+ for (JSONObject jsonObject : jsonObjects) {
|
|
|
|
|
+ String str = jsonObject.getStr("content");
|
|
|
|
|
+ if (str.contains("Your ChatGPT code is")) {
|
|
|
|
|
+ String code = TicketCodeCommonUtil.getTicketCodeStr(str, goodsId);
|
|
|
|
|
+ return code;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
String checkEmail = StrUtil.isNotEmpty(relateEmail) ? relateEmail : account;
|
|
String checkEmail = StrUtil.isNotEmpty(relateEmail) ? relateEmail : account;
|