调整HttpRequest生成方式

old-package
lensfrex 2 years ago
parent c0d1d11693
commit b9e75fcd51
Signed by: lensfrex
GPG Key ID: 0F69A0A2FBEE98A0
  1. 16
      mywust-core/src/main/java/cn/linghang/mywust/core/service/auth/AuthRequestFactory.java
  2. 12
      mywust-core/src/main/java/cn/linghang/mywust/core/service/auth/UnionLogin.java
  3. 7
      mywust-core/src/main/java/cn/linghang/mywust/core/service/library/LibraryAuthRequestFactory.java
  4. 14
      mywust-core/src/main/java/cn/linghang/mywust/core/service/library/LibraryLogin.java
  5. 18
      mywust-core/src/main/java/cn/linghang/mywust/core/service/undergraduate/BkjxAuthRequestFactory.java
  6. 28
      mywust-core/src/main/java/cn/linghang/mywust/core/service/undergraduate/JwcLogin.java
  7. 32
      mywust-network-okhttp/src/main/java/cn/linghang/mywust/network/okhttp/SimpleOkhttpRequester.java
  8. 48
      mywust-network/src/main/java/cn/linghang/mywust/network/HttpRequest.java
  9. 35
      mywust-network/src/main/java/cn/linghang/mywust/network/HttpResponse.java
  10. 27
      mywust-network/src/main/java/cn/linghang/mywust/network/RequestFactory.java
  11. 17
      mywust-network/src/main/java/cn/linghang/mywust/network/Requester.java
  12. 2
      mywust-test/src/test/java/JwcLoginTest.java

@ -1,13 +1,15 @@
package cn.linghang.mywust.core.service.auth;
import cn.linghang.mywust.core.api.UnionAuth;
import cn.linghang.mywust.network.HttpRequest;
import cn.linghang.mywust.network.RequestFactory;
import cn.linghang.mywust.util.StringUtil;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
public class AuthRequestFactory {
public class AuthRequestFactory extends RequestFactory {
public static HttpRequest unionLoginTGTRequest(String username, String password, String service) {
Map<String, String> requestForm = new HashMap<>(4);
requestForm.put("username", username);
@ -17,21 +19,15 @@ public class AuthRequestFactory {
String queryString = StringUtil.generateQueryString(requestForm);
HttpRequest request = new HttpRequest();
request.setData(queryString.getBytes(StandardCharsets.UTF_8));
return request;
return makeHttpRequest(UnionAuth.UNION_AUTH_API, queryString.getBytes(StandardCharsets.UTF_8));
}
public static HttpRequest loginTicketRequest(String service) {
public static HttpRequest loginTicketRequest(String redirectUrl, String service) {
Map<String, String> requestForm = new HashMap<>(1);
requestForm.put("service", service);
String queryString = StringUtil.generateQueryString(requestForm);
HttpRequest request = new HttpRequest();
request.setData(queryString.getBytes(StandardCharsets.UTF_8));
return request;
return makeHttpRequest(redirectUrl, queryString.getBytes(StandardCharsets.UTF_8));
}
}

@ -1,9 +1,7 @@
package cn.linghang.mywust.core.service.auth;
import cn.linghang.mywust.core.api.UnionAuth;
import cn.linghang.mywust.core.exception.BasicException;
import cn.linghang.mywust.core.exception.PasswordWornException;
import cn.linghang.mywust.core.service.undergraduate.BkjxAuthRequestFactory;
import cn.linghang.mywust.network.HttpRequest;
import cn.linghang.mywust.network.HttpResponse;
import cn.linghang.mywust.network.RequestClientOption;
@ -13,7 +11,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.URL;
/**
* 统一认证登录
@ -32,8 +29,7 @@ public class UnionLogin {
// 获取ticket granting ticket(TGT),以获取ServiceTicket
HttpRequest TGTRequest = AuthRequestFactory.unionLoginTGTRequest(username, encodedPassword, serviceUrl);
HttpResponse unionAuthResponse = requester.post(new URL(UnionAuth.UNION_AUTH_API), TGTRequest, requestOption);
HttpResponse unionAuthResponse = requester.post(TGTRequest, requestOption);
String redirectAddress = unionAuthResponse.getHeaders().get("Location");
if (redirectAddress == null) {
@ -41,10 +37,8 @@ public class UnionLogin {
}
// 获取服务ticket(service ticket,ST)
HttpRequest serviceTicketRequest = AuthRequestFactory.loginTicketRequest(serviceUrl);
HttpResponse serviceTicketResponse =
requester.post(new URL(redirectAddress.replace("http:", "https:")), serviceTicketRequest, requestOption);
HttpRequest serviceTicketRequest = AuthRequestFactory.loginTicketRequest(redirectAddress.replace("http:", "https:"), serviceUrl);
HttpResponse serviceTicketResponse = requester.post(serviceTicketRequest, requestOption);
byte[] serviceTicketResponseData = serviceTicketResponse.getBody();
if (serviceTicketResponseData == null) {

@ -1,14 +1,15 @@
package cn.linghang.mywust.core.service.library;
import cn.linghang.mywust.core.api.Library;
import cn.linghang.mywust.network.HttpRequest;
import cn.linghang.mywust.network.RequestFactory;
public class LibraryAuthRequestFactory extends RequestFactory {
public static HttpRequest sessionCookieRequest() {
return DEFAULT_HTTP_REQUEST;
public static HttpRequest sessionCookieRequest(String serviceTicket) {
return makeHttpRequest(String.format(Library.LIBRARY_SESSION_COOKIE_API, serviceTicket));
}
public static HttpRequest indexRequest() {
return DEFAULT_HTTP_REQUEST;
return makeHttpRequest(Library.LIBRARY_INDEX_URL);
}
}

@ -1,19 +1,15 @@
package cn.linghang.mywust.core.service.library;
import cn.linghang.mywust.core.api.Bkjx;
import cn.linghang.mywust.core.api.Library;
import cn.linghang.mywust.core.api.UnionAuth;
import cn.linghang.mywust.core.exception.BasicException;
import cn.linghang.mywust.core.service.auth.UnionLogin;
import cn.linghang.mywust.core.service.undergraduate.BkjxAuthRequestFactory;
import cn.linghang.mywust.network.HttpRequest;
import cn.linghang.mywust.network.HttpResponse;
import cn.linghang.mywust.network.RequestClientOption;
import cn.linghang.mywust.network.Requester;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
public class LibraryLogin {
private final Requester requester;
@ -29,14 +25,14 @@ public class LibraryLogin {
String serviceTicket = unionLogin.getServiceTicket(username, password, UnionAuth.LIBRARY_SSO_SERVICE, requestOption);
// 获取登录cookie(session)
HttpRequest sessionRequest = LibraryAuthRequestFactory.sessionCookieRequest();
HttpResponse sessionResponse = requester.get(new URL(String.format(Library.LIBRARY_SESSION_COOKIE_API, serviceTicket)), sessionRequest, requestOption);
HttpRequest sessionRequest = LibraryAuthRequestFactory.sessionCookieRequest(serviceTicket);
HttpResponse sessionResponse = requester.get(sessionRequest, requestOption);
String cookies = sessionResponse.getCookies();
// 请求一次首页
HttpRequest indexRequest = LibraryAuthRequestFactory.indexRequest();
indexRequest.setCookies(cookies);
requester.get(new URL(Library.LIBRARY_INDEX_URL), indexRequest, requestOption);
requester.get(indexRequest, requestOption);
return cookies;
}
@ -44,9 +40,9 @@ public class LibraryLogin {
public boolean checkCookie(String cookies) throws IOException {
RequestClientOption option = RequestClientOption.DEFAULT_OPTION;
HttpRequest testRequest = LibraryAuthRequestFactory.getDefaultHttpRequest();
HttpRequest testRequest = LibraryAuthRequestFactory.makeHttpRequest(Library.LIBRARY_COOKIE_TEST_URL);
testRequest.setCookies(cookies);
HttpResponse testResponse = requester.get(new URL(Library.LIBRARY_COOKIE_TEST_URL), testRequest, option);
HttpResponse testResponse = requester.get(testRequest, option);
// 响应居然是JSON,好评!
// 但是我们只要看有没有Unauthorized关键字就行了

@ -1,5 +1,6 @@
package cn.linghang.mywust.core.service.undergraduate;
import cn.linghang.mywust.core.api.Bkjx;
import cn.linghang.mywust.network.HttpRequest;
import cn.linghang.mywust.network.RequestFactory;
import cn.linghang.mywust.util.StringUtil;
@ -9,17 +10,13 @@ import java.util.HashMap;
import java.util.Map;
public class BkjxAuthRequestFactory extends RequestFactory {
public static HttpRequest sessionCookieRequest() {
return DEFAULT_HTTP_REQUEST;
}
public static HttpRequest getDefaultHttpRequest() {
return DEFAULT_HTTP_REQUEST;
public static HttpRequest sessionCookieRequest(String serviceTicket) {
return makeHttpRequest(String.format(Bkjx.BKJX_SESSION_COOKIE_API, serviceTicket));
}
public static class Legacy {
public static HttpRequest dataStringRequest() {
return DEFAULT_HTTP_REQUEST;
return makeHttpRequest(Bkjx.Legacy.BKJX_DATA_STRING_API);
}
public static HttpRequest ticketRedirectRequest(String encode) {
@ -34,11 +31,8 @@ public class BkjxAuthRequestFactory extends RequestFactory {
extendHeaders.put("Referer", "http://bkjx.wust.edu.cn/");
extendHeaders.put("Origin", "http://bkjx.wust.edu.cn");
HttpRequest httpRequest = new HttpRequest();
httpRequest.setHeaders(extendHeaders);
httpRequest.setData(queryString.getBytes(StandardCharsets.UTF_8));
return httpRequest;
return makeHttpRequest(Bkjx.Legacy.BKJX_SESSION_COOKIE_API, queryString.getBytes(StandardCharsets.UTF_8))
.addHeaders(extendHeaders);
}
}
}

@ -14,7 +14,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.URL;
public class JwcLogin {
private static final Logger log = LoggerFactory.getLogger(JwcLogin.class);
@ -29,7 +28,7 @@ public class JwcLogin {
}
/**
* <p>旧版的登录方式既相当于直接登录<a href="http://bkjx.wust.edu.cn">bkjx系统不建议使用</a></p>
* <p>旧版的登录方式既相当于直接登录<a href="http://bkjx.wust.edu.cn">bkjx系统</a>不建议使用</p>
* <p>注意这种登录方式的密码和新版可能是不一样的</p>
* <p>不过不论使用哪种登录方式获取到的cookie都是可用的</p>
*
@ -39,7 +38,7 @@ public class JwcLogin {
public String getLoginCookieLegacy(String username, String password, RequestClientOption requestOption) throws IOException, BasicException {
// 获取某段神秘的dataStr(反正官网代码是这么叫的)
HttpRequest dataStringRequest = BkjxAuthRequestFactory.Legacy.dataStringRequest();
HttpResponse dataStringResponse = requester.post(new URL(Bkjx.Legacy.BKJX_DATA_STRING_API), dataStringRequest, requestOption);
HttpResponse dataStringResponse = requester.post(dataStringRequest, requestOption);
if (dataStringResponse.getBody() == null) {
throw new BasicException();
}
@ -50,7 +49,8 @@ public class JwcLogin {
String encoded = PasswordEncoder.legacyPassword(username, password, dataString);
HttpRequest ticketRequest = BkjxAuthRequestFactory.Legacy.ticketRedirectRequest(encoded);
ticketRequest.setCookies(dataStringResponse.getCookies());
HttpResponse ticketResponse = requester.post(new URL(Bkjx.Legacy.BKJX_SESSION_COOKIE_API), ticketRequest, requestOption);
HttpResponse ticketResponse = requester.post(ticketRequest, requestOption);
if (ticketResponse.getBody() == null) {
throw new BasicException();
}
@ -60,9 +60,9 @@ public class JwcLogin {
if (sessionRedirect == null) {
throw new PasswordWornException();
}
HttpRequest sessionRequest = BkjxAuthRequestFactory.Legacy.dataStringRequest();
HttpResponse sessionResponse = requester.get(new URL(sessionRedirect), sessionRequest, requestOption);
HttpRequest sessionRequest = BkjxAuthRequestFactory.makeHttpRequest(sessionRedirect);
HttpResponse sessionResponse = requester.get(sessionRequest, requestOption);
String cookies = sessionResponse.getCookies();
if (roughCheckCookie(cookies)) {
@ -76,8 +76,8 @@ public class JwcLogin {
String serviceTicket = unionLogin.getServiceTicket(username, password, UnionAuth.BKJX_SSO_SERVICE, requestOption);
// 获取登录cookie(session)
HttpRequest sessionRequest = BkjxAuthRequestFactory.sessionCookieRequest();
HttpResponse sessionResponse = requester.get(new URL(String.format(Bkjx.BKJX_SESSION_COOKIE_API, serviceTicket)), sessionRequest, requestOption);
HttpRequest sessionRequest = BkjxAuthRequestFactory.sessionCookieRequest(serviceTicket);
HttpResponse sessionResponse = requester.get(sessionRequest, requestOption);
String cookies = sessionResponse.getCookies();
if (roughCheckCookie(cookies)) {
@ -87,7 +87,7 @@ public class JwcLogin {
return cookies;
}
private boolean roughCheckCookie(String cookies) throws BasicException {
private boolean roughCheckCookie(String cookies) {
return cookies == null || !cookies.contains("JSESSIONID") || !cookies.contains("SERVERID");
}
@ -96,13 +96,9 @@ public class JwcLogin {
"'https://auth.wust.edu.cn/lyuapServer/login?service=http%3A%2F%2Fbkjx.wust.edu.cn%2Fjsxsd%2Fxxwcqk%2Fxxwcqk_idxOnzh.do'" +
"</script>").length();
public boolean checkCookies(String cookies) throws IOException {
RequestClientOption option = RequestClientOption.DEFAULT_OPTION;
HttpRequest testRequest = BkjxAuthRequestFactory.getDefaultHttpRequest();
testRequest.setCookies(cookies);
HttpResponse testResponse = requester.get(new URL(Bkjx.BKJX_TEST_API), testRequest, option);
public boolean checkCookies(String cookies, RequestClientOption option) throws IOException {
HttpRequest testRequest = BkjxAuthRequestFactory.makeHttpRequest(Bkjx.BKJX_TEST_API, null, cookies);
HttpResponse testResponse = requester.get(testRequest, option);
// 判断响应长度是否为178个字,登录跳转响应长度
// 这种办法虽然在极端情况下可能会出错(而且还挺蠢的),但是是最快的办法中比较准确的了

@ -13,9 +13,7 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
@ -186,12 +184,11 @@ public class SimpleOkhttpRequester implements Requester {
* 根据请求信息来构建Request
*
* @param requestMethod 请求方法可选值GET, POST, PUT, DELETE
* @param url 地址
* @param httpRequest 请求体
* @return Request
*/
private Request buildRequest(RequestMethod requestMethod, URL url, HttpRequest httpRequest) {
Request.Builder requestBuilder = new Request.Builder().url(url);
private Request buildRequest(RequestMethod requestMethod, HttpRequest httpRequest) {
Request.Builder requestBuilder = new Request.Builder().url(httpRequest.getUrl());
Map<String, String> requestHeaders = httpRequest.getHeaders();
if (requestHeaders != null) {
@ -268,15 +265,14 @@ public class SimpleOkhttpRequester implements Requester {
* 执行请求
*
* @param requestMethod 请求方法
* @param url 请求地址
* @param httpRequest 请求体
* @param requestClientOption 请求响应
* @return 包装好的Http响应
* @throws IOException 如果网络请求有异常
*/
private HttpResponse doRequest(RequestMethod requestMethod, URL url, HttpRequest httpRequest, RequestClientOption requestClientOption) throws IOException {
private HttpResponse doRequest(RequestMethod requestMethod, HttpRequest httpRequest, RequestClientOption requestClientOption) throws IOException {
OkHttpClient client = getOkhttpClient(requestClientOption);
Request request = this.buildRequest(requestMethod, url, httpRequest);
Request request = this.buildRequest(requestMethod, httpRequest);
log.debug("------------Do Request------------");
log.debug("Request Options: {}" ,requestClientOption);
@ -287,31 +283,31 @@ public class SimpleOkhttpRequester implements Requester {
}
@Override
public HttpResponse get(URL url, HttpRequest httpRequest, RequestClientOption requestClientOption) throws IOException {
return this.doRequest(RequestMethod.GET, url, httpRequest, requestClientOption);
public HttpResponse get(HttpRequest httpRequest, RequestClientOption requestClientOption) throws IOException {
return this.doRequest(RequestMethod.GET, httpRequest, requestClientOption);
}
@Override
public HttpResponse post(URL url, HttpRequest request, RequestClientOption requestClientOption) throws IOException {
return this.doRequest(RequestMethod.POST, url, request, requestClientOption);
public HttpResponse post(HttpRequest request, RequestClientOption requestClientOption) throws IOException {
return this.doRequest(RequestMethod.POST, request, requestClientOption);
}
@Override
public HttpResponse postJson(URL url, HttpRequest request, Object requestBody, RequestClientOption requestClientOption) throws IOException {
public HttpResponse postJson(HttpRequest request, Object requestBody, RequestClientOption requestClientOption) throws IOException {
String json = new ObjectMapper().writeValueAsString(requestBody);
request.setData(json.getBytes(StandardCharsets.UTF_8));
request.getHeaders().put("Content-Type", JSON_CONTENT_TYPE);
return this.doRequest(RequestMethod.POST, url, request, requestClientOption);
return this.doRequest(RequestMethod.POST, request, requestClientOption);
}
@Override
public HttpResponse put(URL url, HttpRequest request, RequestClientOption requestClientOption) throws IOException {
return this.doRequest(RequestMethod.PUT, url, request, requestClientOption);
public HttpResponse put(HttpRequest request, RequestClientOption requestClientOption) throws IOException {
return this.doRequest(RequestMethod.PUT, request, requestClientOption);
}
@Override
public HttpResponse delete(URL url, HttpRequest request, RequestClientOption requestClientOption) throws IOException {
return this.doRequest(RequestMethod.DELETE, url, request, requestClientOption);
public HttpResponse delete(HttpRequest request, RequestClientOption requestClientOption) throws IOException {
return this.doRequest(RequestMethod.DELETE, request, requestClientOption);
}
}

@ -2,6 +2,7 @@ package cn.linghang.mywust.network;
import lombok.Data;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
@ -20,7 +21,7 @@ public class HttpRequest {
return defaultHeaders;
}
private Map<String, String> urlParams;
private URL url;
private Map<String, String> headers;
@ -32,14 +33,15 @@ public class HttpRequest {
headers = new HashMap<>(DEFAULT_HEADERS);
}
public void setHeaders(Map<String, String> headers) {
public HttpRequest addHeaders(Map<String, String> headers) {
this.headers.putAll(headers);
return this;
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("HttpRequest{");
sb.append("urlParams=").append(urlParams);
sb.append("urlParams=").append(url);
sb.append(", headers=").append(headers);
sb.append(", cookies='").append(cookies).append('\'');
sb.append(", data=");
@ -50,4 +52,44 @@ public class HttpRequest {
sb.append('}');
return sb.toString();
}
public static HttpRequestBuilder builder() {
return new HttpRequestBuilder();
}
public static class HttpRequestBuilder {
private final HttpRequest httpRequest;
private HttpRequestBuilder() {
httpRequest = new HttpRequest();
}
public static HttpRequestBuilder aHttpRequest() {
return new HttpRequestBuilder();
}
public HttpRequestBuilder url(URL url) {
httpRequest.setUrl(url);
return this;
}
public HttpRequestBuilder headers(Map<String, String> headers) {
httpRequest.setHeaders(headers);
return this;
}
public HttpRequestBuilder cookies(String cookies) {
httpRequest.setCookies(cookies);
return this;
}
public HttpRequestBuilder data(byte[] data) {
httpRequest.setData(data);
return this;
}
public HttpRequest build() {
return httpRequest;
}
}
}

@ -25,4 +25,39 @@ public class HttpResponse {
sb.append('}');
return sb.toString();
}
public static HttpResponseBuilder builder() {
return new HttpResponseBuilder();
}
public static final class HttpResponseBuilder {
private final HttpResponse httpResponse;
private HttpResponseBuilder() {
httpResponse = new HttpResponse();
}
public static HttpResponseBuilder aHttpResponse() {
return new HttpResponseBuilder();
}
public HttpResponseBuilder headers(Map<String, String> headers) {
httpResponse.setHeaders(headers);
return this;
}
public HttpResponseBuilder cookies(String cookies) {
httpResponse.setCookies(cookies);
return this;
}
public HttpResponseBuilder body(byte[] body) {
httpResponse.setBody(body);
return this;
}
public HttpResponse build() {
return httpResponse;
}
}
}

@ -1,9 +1,32 @@
package cn.linghang.mywust.network;
import java.net.URL;
public class RequestFactory {
protected static final HttpRequest DEFAULT_HTTP_REQUEST = new HttpRequest();
public static HttpRequest getDefaultHttpRequest() {
return DEFAULT_HTTP_REQUEST;
public static HttpRequest makeHttpRequest(String url) {
return makeHttpRequest(url, null, null);
}
public static HttpRequest makeHttpRequest(String url, byte[] data) {
return makeHttpRequest(url, data, null);
}
public static HttpRequest makeHttpRequest(String url, byte[] data, String cookies) {
return HttpRequest.builder()
.url(makeUrl(url))
.data(data)
.cookies(cookies)
.build()
.addHeaders(DEFAULT_HTTP_REQUEST.getHeaders());
}
public static URL makeUrl(String url) {
try {
return new URL(url);
} catch (Exception e) {
return null;
}
}
}

@ -1,7 +1,6 @@
package cn.linghang.mywust.network;
import java.io.IOException;
import java.net.URL;
/**
* <p>请求类的上层封装接口传入参数直接进行请求</p>
@ -18,55 +17,51 @@ public interface Requester {
/**
* 发送Get请求
*
* @param url 请求地址
* @param request 请求体
* @param requestClientOption 请求选项
* @return 响应数据
* @throws IOException 如果网络请求有异常
*/
HttpResponse get(URL url, HttpRequest request, RequestClientOption requestClientOption) throws IOException;
HttpResponse get(HttpRequest request, RequestClientOption requestClientOption) throws IOException;
/**
* 发送Post请求
*
* @param url 请求地址
* @param request 请求体
* @param requestClientOption 请求选项
* @return 响应数据
* @throws IOException 如果网络请求有异常
*/
HttpResponse post(URL url, HttpRequest request, RequestClientOption requestClientOption) throws IOException;
HttpResponse post(HttpRequest request, RequestClientOption requestClientOption) throws IOException;
/**
* 发送Post请求并将对象自动封装成json
*
* @param url 请求地址
* @param request 请求体
* @param requestClientOption 请求选项
* @return 响应数据
* @throws IOException 如果网络请求有异常
*/
HttpResponse postJson(URL url, HttpRequest request, Object requestBody, RequestClientOption requestClientOption) throws IOException;
HttpResponse postJson(HttpRequest request, Object requestBody, RequestClientOption requestClientOption) throws IOException;
/**
* 发送Put请求
*
* @param url 请求地址
* @param request 请求体
* @param requestClientOption 请求选项
* @return 响应数据
* @throws IOException 如果网络请求有异常
*/
HttpResponse put(URL url, HttpRequest request, RequestClientOption requestClientOption) throws IOException;
HttpResponse put(HttpRequest request, RequestClientOption requestClientOption) throws IOException;
/**
* 发送Delete请求
*
* @param url 请求地址
* @param request 请求体
* @param requestClientOption 请求选项
* @return 响应数据
* @throws IOException 如果网络请求有异常
*/
HttpResponse delete(URL url, HttpRequest request, RequestClientOption requestClientOption) throws IOException;
HttpResponse delete(HttpRequest request, RequestClientOption requestClientOption) throws IOException;
}

@ -39,6 +39,6 @@ public class JwcLoginTest {
System.out.printf("获取到Cookies: %s \n", cookies);
System.out.printf("检查Cookies: %s", jwcLogin.checkCookies(cookies));
System.out.printf("检查Cookies: %s", jwcLogin.checkCookies(cookies, RequestClientOption.DEFAULT_OPTION));
}
}

Loading…
Cancel
Save