Procházet zdrojové kódy

ADOBE获取验证码

zoujiajian před 6 měsíci
rodič
revize
e091088ecf

+ 5 - 0
netflix-common/src/main/java/com/cyksj/common/constant/Constant.java

@@ -797,4 +797,9 @@ public interface Constant {
 	 * CHONG.AFDIAN 代充
 	 */
 	Long CHONG_AF_DIAN_CHANNEL_ID = 7L;
+
+	/**
+	 * Adobe 全家桶
+	 */
+	Long ADOBE_GOODS_ID = 45L;
 }

+ 26 - 0
netflix-dao/src/main/java/com/cyksj/model/response/AdobeEmailResp.java

@@ -0,0 +1,26 @@
+package com.cyksj.model.response;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 项目名: yhlxj11111111
+ * 文件名: AdobeEmailResp
+ * 创建者: JavaZou
+ * 创建时间:2026/2/9 14:48
+ */
+@Getter
+@Setter
+public class AdobeEmailResp {
+	private Long id;
+
+	private String message_id;
+
+	private String source;
+
+	private String address;
+
+	private String raw;
+
+	private String created_at;
+}

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

@@ -1,5 +1,6 @@
 package com.cyksj.service.mail.impl;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpRequest;
@@ -9,16 +10,20 @@ import cn.hutool.json.JSONObject;
 import com.cyksj.common.constant.Constant;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.util.Jsons;
+import com.cyksj.common.util.StringUtil;
 import com.cyksj.common.util.TicketCodeCommonUtil;
+import com.cyksj.model.response.AdobeEmailResp;
 import com.cyksj.model.response.DisneyCodeResp;
 import com.cyksj.service.mail.CommonMailService;
 import com.cyksj.service.mail.CuiQiuMailService;
 import com.cyksj.service.mail.MailLuService;
 import com.cyksj.service.mail.YhMailService;
 import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 项目名: yhlxj
@@ -28,6 +33,7 @@ import java.util.Date;
  */
 @Service
 @RequiredArgsConstructor
+@Slf4j
 public class CommonMailServiceImpl implements CommonMailService {
 	private final CuiQiuMailService cuiQiuMailService;
 
@@ -55,21 +61,48 @@ public class CommonMailServiceImpl implements CommonMailService {
 					}
 
 				} catch (Exception e) {
+
 				}
 			}
 		}
 		//迪士尼 获取验证码
 		if (goodsId == Constant.DISNEY_GID) {
-			String url = "https://32t.cn/api/v1/code/" + emailPwd;
-			HttpRequest post = HttpUtil.createGet(url);
-			HttpResponse execute = post.execute();
-			JSONObject resp = Jsons.parseObject(execute.body(), JSONObject.class);
-			Object data = resp.getObj("data");
-			if (data != null) {
-				DisneyCodeResp codeData = Jsons.parseObject(data, DisneyCodeResp.class);
-				return codeData.getCode();
+			try {
+				String url = "https://32t.cn/api/v1/code/" + emailPwd;
+				HttpRequest post = HttpUtil.createGet(url);
+				HttpResponse execute = post.execute();
+				JSONObject resp = Jsons.parseObject(execute.body(), JSONObject.class);
+				Object data = resp.getObj("data");
+				if (data != null) {
+					DisneyCodeResp codeData = Jsons.parseObject(data, DisneyCodeResp.class);
+					return codeData.getCode();
+				}
+			} catch (Exception e) {
+				log.error("迪士尼 {}获取验证码失败:{}", account, StringUtil.getErrorMsg(e));
 			}
 		}
+		//Adobe 获取验证码
+		if (goodsId == Constant.ADOBE_GOODS_ID) {
+			try {
+				String url = "https://xinapi.adbacc.top/admin/mails?limit=20&offset=0&email=" + account;
+				HttpRequest post = HttpUtil.createGet(url).header("x-admin-auth", "xin456");
+				HttpResponse execute = post.execute();
+				JSONObject resp = Jsons.parseObject(execute.body(), JSONObject.class);
+				List<AdobeEmailResp> AdobeEmailResps = Jsons.parseList(resp.getObj("results"), AdobeEmailResp.class);
+				if (CollUtil.isNotEmpty(AdobeEmailResps)) {
+					for (AdobeEmailResp adobeEmailResp : AdobeEmailResps) {
+						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);
+						}
+					}
+				}
+			} catch (Exception e) {
+				log.error("Adobe {}获取验证码:{}", account, StringUtil.getErrorMsg(e));
+			}
+		}
+
 		String checkEmail = StrUtil.isNotEmpty(relateEmail) ? relateEmail : account;
 		//关联邮箱
 		if (cuiQiuMailService.isCuiQiuEmail(checkEmail)) {

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/mail/impl/YhEmailServiceImpl.java

@@ -87,7 +87,7 @@ public class YhEmailServiceImpl implements YhMailService {
 				.last("limit 1"));
 		if (sysEmail == null) {
 			log.info("获取账号:{}验证码异常,未配置对应系统邮箱", account);
-			throw BusinessRuntimeException.getInstance("对应邮箱配置不存在...");
+			throw BusinessRuntimeException.getInstance("获取验证码失败...");
 		}
 		String url = "http://yinhelx.com/api/controller.php";
 		Map<String, Object> params = new HashMap<>();

+ 6 - 1
netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java

@@ -803,7 +803,12 @@ public class CmsAccountController {
 		}
 		delAccountRecord.setAccountInfo(Jsons.toJson(account));
 		delAccountRecordMapper.insert(delAccountRecord);
-        return GatewayResponse.SUCCESS.newBuilder().toResult();
+
+		String key = RedisService.key.DUP_GOODS_ACCOUNT_KEY.getNameFormat(account.getGoodsId(), account);
+		if (redisService.hasKey(key)) {
+			redisService.del(key);
+		}
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
     }
 
 	/**