|
|
@@ -1,5 +1,6 @@
|
|
|
package com.jzg.quotation.taishan.crawler.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.jzg.commons.constants.quote.enums.base.ExpenseRequestUrl;
|
|
|
import com.jzg.commons.entity.quote.vo.base.LoginBase;
|
|
|
import com.jzg.commons.entity.quote.vo.identify.SliderCaptchaVo;
|
|
|
@@ -16,6 +17,7 @@ import com.jzg.quotation.taishan.crawler.entity.response.TaiShanCrawlerVerifyRes
|
|
|
import com.jzg.quotation.taishan.crawler.service.TaiShanCrawlerQuoteProcessService;
|
|
|
import com.jzg.quotation.taishan.crawler.util.TaiShanCrawlerUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -34,6 +36,7 @@ import java.util.concurrent.ThreadLocalRandom;
|
|
|
**/
|
|
|
@Service
|
|
|
@RequiredArgsConstructor
|
|
|
+@Slf4j
|
|
|
public class TaiShanCrawlerQuoteProcessServiceImpl implements TaiShanCrawlerQuoteProcessService {
|
|
|
|
|
|
private final TaiShanCrawlerRequestComponent taiShanCrawlerRequestComponent;
|
|
|
@@ -170,12 +173,46 @@ public class TaiShanCrawlerQuoteProcessServiceImpl implements TaiShanCrawlerQuot
|
|
|
*/
|
|
|
@Override
|
|
|
public HttpHeaders getHeaders(String username, String comCode) {
|
|
|
- String authorization = taiShanCrawlerCacheComponent.getAuthorization(username);
|
|
|
+ String authorization = "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI1ODI0MjEiLCJhdXRoIjoiUk9MRV9CVVNJTkVTUyIsInBhc3N3b3JkX2V4cGlyZSI6MTUsImV4cCI6MTc4MTY4NzIzMn0.ldWz9TMY4AJ75VE0Bk1mkzAXPC9jJNMIWL82n0kGHrBwASgGvBxO3fe7orHbCIowt0athoRn1zA9m5ZNnO7olg";
|
|
|
HttpHeaders httpHeaders = new HttpHeaders();
|
|
|
+
|
|
|
+ httpHeaders.set("Accept", "application/json, text/plain, */*");
|
|
|
+ httpHeaders.set("Accept-Language", "zh-CN,zh;q=0.9");
|
|
|
+ httpHeaders.set("Cache-Control", "no-cache");
|
|
|
+ httpHeaders.set("Connection", "keep-alive");
|
|
|
+ httpHeaders.set("Content-Type", "application/json;charset=UTF-8");
|
|
|
+ httpHeaders.set("Host", "kc.taishanpic.com.cn");
|
|
|
+ httpHeaders.set("Origin", "https://kc.taishanpic.com.cn");
|
|
|
+ httpHeaders.set("Pragma", "no-cache");
|
|
|
+ httpHeaders.set("Referer", "https://kc.taishanpic.com.cn/pc_prod/underwriting/insurance");
|
|
|
+ httpHeaders.set("Sec-Fetch-Dest", "empty");
|
|
|
+ httpHeaders.set("Sec-Fetch-Mode", "cors");
|
|
|
+ httpHeaders.set("Sec-Fetch-Site", "same-origin");
|
|
|
+ httpHeaders.set("Source", "0");
|
|
|
+ httpHeaders.set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Safari/537.36");
|
|
|
+ httpHeaders.set("sec-ch-ua", "\"Chromium\";v=\"122\", \"Not(A:Brand\";v=\"24\", \"Google Chrome\";v=\"122\"");
|
|
|
+ httpHeaders.set("sec-ch-ua-mobile", "?0");
|
|
|
+ httpHeaders.set("sec-ch-ua-platform", "\"Windows\"");
|
|
|
+
|
|
|
httpHeaders.set("Authorization", authorization);
|
|
|
- httpHeaders.set("Authorization", "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI1ODI1MzAiLCJhdXRoIjoiUk9MRV9FTVBUWV9DQVJEX05PLFJPTEVfT1BFUkFUT1IiLCJwYXNzd29yZF9leHBpcmUiOi04NywiZXhwIjoxNzY2NzI5MTg1fQ.80zkJmVQoc1kvjWiGMzbc5kaWY56FpVN-NAW3qCldeEGX61wPLmh_9sgyl7Oy_fFnmghC5szZrZEuN_byucCFw");
|
|
|
httpHeaders.set("Login-Complete", comCode);
|
|
|
- httpHeaders.set("Source","0");
|
|
|
+
|
|
|
+ int randomInteger = ThreadLocalRandom.current().nextInt(1, 11);
|
|
|
+ long currentTimeMillis = System.currentTimeMillis();
|
|
|
+
|
|
|
+ long seconds = currentTimeMillis / 1000;
|
|
|
+ long milliseconds = currentTimeMillis % 1000;
|
|
|
+ String timeStr = seconds + "." + milliseconds;
|
|
|
+ String serialNo = md5Encrypt(String.valueOf(randomInteger) + timeStr);
|
|
|
+ httpHeaders.set("Serial-NO", serialNo);
|
|
|
+
|
|
|
+ String t = String.valueOf(currentTimeMillis);
|
|
|
+ httpHeaders.set("T", t);
|
|
|
+
|
|
|
+ String signatureStr = "20250227210036" + "20250227210106" + t + authorization;
|
|
|
+ String a = md5Encrypt(signatureStr);
|
|
|
+ httpHeaders.set("a", a);
|
|
|
+
|
|
|
return httpHeaders;
|
|
|
}
|
|
|
|