|
@@ -55,13 +55,13 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @param type 1:奈飞安全码
|
|
|
|
|
- * @param linkType 链接 1:同步验证链接
|
|
|
|
|
|
|
+ * @param type 1:奈飞安全码
|
|
|
|
|
+ * @param linkType 链接 1:同步验证链接
|
|
|
* @param isReturnDeviceUrl true 直接返回同步装置url
|
|
* @param isReturnDeviceUrl true 直接返回同步装置url
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public String getVerifyCode(String email, Long goodsId, Integer type, Integer linkType, Boolean isReturnDeviceUrl) throws Exception {
|
|
|
|
|
- //获取近二十封邮件
|
|
|
|
|
|
|
+ public String getVerifyCode(String email, String relateEmail, Long goodsId, Integer type, Integer linkType, Boolean isReturnDeviceUrl) throws Exception {
|
|
|
|
|
+ //获取近十封邮件
|
|
|
String url = "https://domain-open-api.cuiqiu.com/v1/message/list";
|
|
String url = "https://domain-open-api.cuiqiu.com/v1/message/list";
|
|
|
|
|
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
@@ -70,15 +70,16 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
|
|
|
//维度是天
|
|
//维度是天
|
|
|
DateTime now = DateTime.now();
|
|
DateTime now = DateTime.now();
|
|
|
params.put("token", CUI_QIU_TOKEN);
|
|
params.put("token", CUI_QIU_TOKEN);
|
|
|
- String mailId = getAdmainMailId(email);
|
|
|
|
|
|
|
+ //关联邮件域名
|
|
|
|
|
+ String mailId = getAdmainMailId(StrUtil.isNotEmpty(relateEmail) ? relateEmail : email);
|
|
|
if (StrUtil.isEmpty(mailId)) {
|
|
if (StrUtil.isEmpty(mailId)) {
|
|
|
throw BusinessRuntimeException.getInstance("系统异常,请联系客服..");
|
|
throw BusinessRuntimeException.getInstance("系统异常,请联系客服..");
|
|
|
}
|
|
}
|
|
|
params.put("mail_id", mailId);
|
|
params.put("mail_id", mailId);
|
|
|
params.put("start_time", DateUtil.offsetDay(now, -1).toDateStr());
|
|
params.put("start_time", DateUtil.offsetDay(now, -1).toDateStr());
|
|
|
params.put("end_time", DateUtil.offsetDay(now, 1).toDateStr());
|
|
params.put("end_time", DateUtil.offsetDay(now, 1).toDateStr());
|
|
|
- params.put("to", email);
|
|
|
|
|
- params.put("limit", 20);
|
|
|
|
|
|
|
+// params.put("to", email);
|
|
|
|
|
+ params.put("limit", 10);
|
|
|
|
|
|
|
|
HttpRequest post = HttpUtil.createPost(url);
|
|
HttpRequest post = HttpUtil.createPost(url);
|
|
|
post.form(params);
|
|
post.form(params);
|
|
@@ -91,18 +92,23 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
|
|
|
//获取邮箱对应的邮件
|
|
//获取邮箱对应的邮件
|
|
|
list = list.stream().filter(emailInfo -> {
|
|
list = list.stream().filter(emailInfo -> {
|
|
|
CuiQiuEmailDto.CuiQiuUser from = emailInfo.getFrom().get(0);
|
|
CuiQiuEmailDto.CuiQiuUser from = emailInfo.getFrom().get(0);
|
|
|
|
|
+ CuiQiuEmailDto.CuiQiuUser to = emailInfo.getTo().get(0);
|
|
|
CuiQiuEmailDto.CuiQiuUser cuiQiuUser = emailInfo.getTo().get(0);
|
|
CuiQiuEmailDto.CuiQiuUser cuiQiuUser = emailInfo.getTo().get(0);
|
|
|
if (StrUtil.equalsIgnoreCase(cuiQiuUser.getAddress(), email)) {
|
|
if (StrUtil.equalsIgnoreCase(cuiQiuUser.getAddress(), email)) {
|
|
|
- //PS
|
|
|
|
|
- if (from.getName().contains(Constant.PS_ADOBE)) {
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- //Disney
|
|
|
|
|
- if (from.getName().contains(Constant.DISNEY)) {
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- if (from.getName().contains(Constant.NETFLIX)) {
|
|
|
|
|
- return true;
|
|
|
|
|
|
|
+ String toEmail = to.getAddress();
|
|
|
|
|
+ //通过直达邮件判断
|
|
|
|
|
+ if (StrUtil.equals(toEmail, email) || StrUtil.equals(toEmail, relateEmail)) {
|
|
|
|
|
+ //PS
|
|
|
|
|
+ if (goodsId == Constant.PS_GID && from.getName().contains(Constant.PS_ADOBE)) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ //Disney
|
|
|
|
|
+ if (goodsId == Constant.DISNEY_GID && from.getName().contains(Constant.DISNEY)) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (goodsId == Constant.NETFLIX_GID && from.getName().contains(Constant.NETFLIX)) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return false;
|
|
return false;
|