|
|
@@ -44,10 +44,14 @@ public class CommonMailServiceImpl implements CommonMailService {
|
|
|
HttpRequest post = HttpUtil.createGet(url);
|
|
|
HttpResponse execute = post.execute();
|
|
|
List<JSONObject> jsonObjects = Jsons.parseList(execute.body(), JSONObject.class);
|
|
|
- JSONObject jsonObject = jsonObjects.get(0);
|
|
|
- String str = jsonObject.getStr("content");
|
|
|
- String code = TicketCodeCommonUtil.getTicketCodeStr(str, goodsId);
|
|
|
- return code;
|
|
|
+ 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) {
|
|
|
}
|
|
|
}
|