|
|
|
@ -43,6 +43,7 @@ public class XxlJobServiceImpl implements XxlJobService {
|
|
|
|
|
HttpPost httpPost = new HttpPost(xxlJobAdminAddress + XxlJobConstants.URL_LOGIN);
|
|
|
|
|
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
|
|
|
|
|
String params = "userName=" + username + "&password=" + password + "&ifRemember=on";
|
|
|
|
|
log.info("xxl-job-admin登录请求参数: {}", params);
|
|
|
|
|
StringEntity entity = new StringEntity(params, ContentType.APPLICATION_FORM_URLENCODED);
|
|
|
|
|
httpPost.setEntity(entity);
|
|
|
|
|
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
|
|
|
|
@ -50,6 +51,7 @@ public class XxlJobServiceImpl implements XxlJobService {
|
|
|
|
|
Header[] headers = response.getHeaders();
|
|
|
|
|
for (Header header : headers) {
|
|
|
|
|
if ("Set-Cookie".equals(header.getName())) {
|
|
|
|
|
log.info("Set-Cookie: {}", header.getValue());
|
|
|
|
|
token = header.getValue();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|