zoujiajian 1 rok temu
rodzic
commit
d9d4010fd3

+ 8 - 4
netflix-service/src/main/java/com/cyksj/service/mail/impl/CommonMailServiceImpl.java

@@ -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) {
 			}
 		}