Browse Source

fix:修改默认的tokenredis存储时间

dev
pref_mail@163.com 1 month ago
parent
commit
5d59447798
  1. 55
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/job/SpiderDataJob.java

55
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/job/SpiderDataJob.java

@ -0,0 +1,55 @@
package com.logpm.factorydata.suofeiya.job;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import java.util.HashMap;
import java.util.Map;
public class SpiderDataJob {
public static void main(String[] args) {
String url = "https://portal.sfygroup.com/reporthome/rest/loadingHeader/all?_dc=1739871711195&page=1&start=0&limit=100&filtersRaw=[{\"id\":null,\"property\":\"A.DEAL_DATE\",\"value\":\"2025-02-11\",\"operator\":\">=\",\"sql\":null},{\"id\":null,\"property\":\"A.DEAL_DATE\",\"value\":\"2025-02-19\",\"operator\":\"<\",\"sql\":null}]";
// // 发起http请求 获取返回的数据 走get请求
//
//
//
Map<String, String> heads = new HashMap<>();
heads.put("Content-Type", "application/json;charset=UTF-8");
// heads.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36");
// heads.put("Host", "portal.sfygroup.com");
// heads.put("Accept", "*/*");
heads.put("Cookie", init());
// heads.put("Referer", "http://portal.sfygroup.com/reporthome/rest/reporthome/reporthomeUI?username=18166360906&password=02a962f8b9dfdbe85ee37b3f9b99fd8fcb48e73a65c9009e92ab81c508dcdca261af7efc1644002d0f371e5001c30a8f&menuType=loadingheader/loadingheader.jsp");
HttpRequest get = HttpUtil.createGet(url).addHeaders(heads);
// String s = HttpUtil.get(url);
// System.out.println(s);
HttpResponse execute = get.setReadTimeout(10000).execute();
String body = execute.body();
System.out.println(body);
// init();
}
private static String init() {
String url = "https://portal.sfygroup.com/reporthome/rest/reporthome/reporthomeUI?username=18166360906&password=02a962f8b9dfdbe85ee37b3f9b99fd8fcb48e73a65c9009e92ab81c508dcdca261af7efc1644002d0f371e5001c30a8f&menuType=loadingheader/loadingheader.jsp";
HttpRequest get = HttpUtil.createGet(url);
HttpResponse execute = get.execute();
String cookie = execute.getCookieStr();
System.out.println(cookie);
return cookie;
// String body = execute.body();
// System.out.println(body);
}
}
Loading…
Cancel
Save