|
@@ -1,11 +1,15 @@
|
|
|
package com.cyksj.service.mange.impl;
|
|
package com.cyksj.service.mange.impl;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.http.HttpRequest;
|
|
|
|
|
+import cn.hutool.http.Method;
|
|
|
import com.cyksj.common.util.J11HttpC;
|
|
import com.cyksj.common.util.J11HttpC;
|
|
|
import com.cyksj.model.entity.SysEmail;
|
|
import com.cyksj.model.entity.SysEmail;
|
|
|
import com.cyksj.service.mange.SysEmailService;
|
|
import com.cyksj.service.mange.SysEmailService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import java.net.InetSocketAddress;
|
|
|
|
|
+import java.net.Proxy;
|
|
|
import java.net.http.HttpResponse;
|
|
import java.net.http.HttpResponse;
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -20,13 +24,34 @@ public class SysEmailServiceImpl implements SysEmailService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void verifyEmail(SysEmail sysEmail) throws Exception {
|
|
public void verifyEmail(SysEmail sysEmail) throws Exception {
|
|
|
|
|
+ String url = String.format("http://yinhelx.com/api/imap_yhcz.php?yhm=%s&mm=%s&duan_kou=143&ip=127.0.0.1&mi_yao=%s",
|
|
|
|
|
+ sysEmail.getEmail(),
|
|
|
|
|
+ sysEmail.getPassword(),
|
|
|
|
|
+ sysEmail.getSecret());
|
|
|
HttpResponse<String> send = J11HttpC.custom()
|
|
HttpResponse<String> send = J11HttpC.custom()
|
|
|
- .url(String.format("yinhelx.com/api/imap_yhcz.php?yhm=%s&mm=%s=143&ip=127.0.0.1&mi_yao=%s",
|
|
|
|
|
- sysEmail.getEmail(),
|
|
|
|
|
- sysEmail.getPassword(),
|
|
|
|
|
- sysEmail.getSecret()))
|
|
|
|
|
|
|
+ .url(url)
|
|
|
.ofGet()
|
|
.ofGet()
|
|
|
.send(HttpResponse.BodyHandlers.ofString());
|
|
.send(HttpResponse.BodyHandlers.ofString());
|
|
|
String body = send.body();
|
|
String body = send.body();
|
|
|
|
|
+ String[] split = body.split("验证登陆");
|
|
|
|
|
+ if (split.length < 2) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ String login = split[1];
|
|
|
|
|
+ int index2 = login.indexOf("https://click.discord.com/ls/click");
|
|
|
|
|
+ if (index2 == -1) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ String verifyUrl = login.substring(index2).replaceAll("<br>", "").trim();
|
|
|
|
|
+
|
|
|
|
|
+ Proxy proxy = new Proxy(Proxy.Type.HTTP,
|
|
|
|
|
+ new InetSocketAddress("43.154.170.87", 8080));
|
|
|
|
|
+ HttpRequest request = new HttpRequest(verifyUrl);
|
|
|
|
|
+ request.setProxy(proxy);
|
|
|
|
|
+ request.setMethod(Method.GET);
|
|
|
|
|
+ request.setConnectionTimeout(15 * 1000);
|
|
|
|
|
+ request.setReadTimeout(15 * 1000);
|
|
|
|
|
+
|
|
|
|
|
+ request.execute().body();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|