Ver código fonte

cookie登录

helixiao 1 ano atrás
pai
commit
677694a229

+ 112 - 111
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/component/HtCrawlerRequestComponent.java

@@ -17,18 +17,13 @@ import org.redisson.api.RedissonClient;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
-import org.springframework.web.reactive.function.client.ClientResponse;
-import org.springframework.web.reactive.function.client.WebClient;
-import reactor.core.publisher.Mono;
 
 import java.io.IOException;
 import java.net.HttpURLConnection;
 import java.net.URL;
-import java.time.Duration;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 /**
  * @description:
@@ -45,6 +40,8 @@ public class HtCrawlerRequestComponent {
 
     private final RedissonClient redissonClient;
 
+    private final HuaTaiCrawlerCacheComponent huaTaiCrawlerCacheComponent;
+
     /**
      * 登录
      * @param username
@@ -53,24 +50,15 @@ public class HtCrawlerRequestComponent {
      * @param loginsNumber
      * @return
      */
-    public List<String> authenticate(String username, String password, String comcode, int loginsNumber) {
-        List<String> haTaiCookie = getHaTaiCookie(RequestUrl.COOKIE.getRequestUrl(huaTaiCrawlerProperties.getBaseUrl()));
+    public String authenticate(String username, String password, String comcode, int loginsNumber) {
+        String haTaiCookie = getHaTaiCookie(RequestUrl.EN_COOKIE.getRequestUrl(huaTaiCrawlerProperties.getBaseUrl()));
         System.out.println(haTaiCookie);
         HtCrawlerLoginRequest htCrawlerLoginRequest = new HtCrawlerLoginRequest(username, password, comcode);
-        ResponseEntity<HtCrawlerLoginResponse> loginResponseEntity = requestComponent.objectPost(RequestUrl.AUTHENTICATE.getRequestUrl(huaTaiCrawlerProperties.getBaseUrl()), htCrawlerLoginRequest, HtCrawlerLoginResponse.class);
-        List<String> cookies = loginResponseEntity.getHeaders().get("Set-Cookie");
-        if (cookies != null && !cookies.isEmpty()) {
-            Map<String, Object> authorizationMap = buildCache(loginResponseEntity);
-            RMap<Object, Object> map = redissonClient.getMap(CacheConstant.HUATAI_AUTHORIZATION + username);
-            map.putAll(authorizationMap);
-            map.expire(Duration.ofDays(CacheConstant.GR_SPECIAL_AGREEMENT_TIME));
-            return (List<String>) authorizationMap.get(HtRequestConstant.COOKIE);
-        }
-        loginsNumber = loginsNumber - 1;
-        if (loginsNumber <= 0) {
-            throw new SystemException("华泰财险登录异常");
-        }
-        return authenticate(username, password, comcode, loginsNumber);
+        HttpHeaders httpHeaders = getHeaders();
+        httpHeaders.add("referer",RequestUrl.COOKIE.getUrl());
+        ResponseEntity<String> loginResponseEntity = requestComponent.objectPost(RequestUrl.NE_AUTHENTICATE.getRequestUrl(huaTaiCrawlerProperties.getBaseUrl()), htCrawlerLoginRequest, String.class,httpHeaders);
+        System.out.println(loginResponseEntity);
+        return  loginResponseEntity.getBody();
     }
 
     public Map<String, Object> buildCache(ResponseEntity<HtCrawlerLoginResponse> loginResponseEntity) {
@@ -82,108 +70,111 @@ public class HtCrawlerRequestComponent {
 
     /**
      * 获取cookie
-     * @param username
      * @return
      */
-    public List<String> getCookie(String username) {
-        return (List<String>) redissonClient.getMap(CacheConstant.HUATAI_AUTHORIZATION + username).get(HtRequestConstant.COOKIE);
+    public String getCookie() {
+        return  huaTaiCrawlerCacheComponent.getCookie();
     }
 
-    public List<String>  getHaTaiCookie(String link) {
-//        try {
-//            // 请求头设置
-//            String[] headers = {
-//                    "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
-//                    "Accept-Language: zh-CN,zh;q=0.9,en;q=0.8",
-//                    "Cache-Control: no-cache",
-//                    "Connection: keep-alive",
-//                    "Pragma: no-cache",
-//                    "Upgrade-Insecure-Requests: 1",
-//                    "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
-//            };
-//            // 创建URL对象
-//            URL url = new URL(link);
+    public String  getHaTaiCookie(String link) {
+        try {
+            // 请求头设置
+            String[] headers = {
+                    "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
+                    "Accept-Language: zh-CN,zh;q=0.9,en;q=0.8",
+                    "Cache-Control: no-cache",
+                    "Connection: keep-alive",
+                    "Pragma: no-cache",
+                    "Upgrade-Insecure-Requests: 1",
+                    "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
+            };
+            // 创建URL对象
+            URL url = new URL(link);
+
+            // 打开连接
+            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+
+            // 设置请求方法为GET
+            connection.setRequestMethod("GET");
+            // 添加请求头
+            for (String header : headers) {
+                String[] parts = header.split(":", 2);
+                if (parts.length == 2) {
+                    connection.setRequestProperty(parts[0].trim(), parts[1].trim());
+                }
+            }
+
+            // 获取响应码
+            int responseCode = connection.getResponseCode();
+//            Map<String, List<String>> requestProperties = connection.getRequestProperties();
+//            String cookie1 = connection.getRequestProperty("Cookie");
+            System.out.println("响应码: " + responseCode);
+
+            // 获取所有响应头
+            Map<String, List<String>> headersList = connection.getHeaderFields();
+            StringBuilder builder = new StringBuilder();
+            // 检查并获取Cookie
+            if (headersList.containsKey("Set-Cookie")) {
+                List<String> cookies = headersList.get("Set-Cookie");
+                System.out.println("获取到的Cookie:");
+                String s = cookies.get(0).split(";")[0];
+                String s1 = cookies.get(1).split(";")[0];
+                builder.append(s1).append(";").append(s);
+                huaTaiCrawlerCacheComponent.cacheCookie(builder.toString());
+                return builder.toString();
+            } else {
+                System.out.println("响应头中没有找到Cookie");
+            }
+
+            // 关闭连接
+            connection.disconnect();
+
+        } catch (IOException e) {
+            System.err.println("请求过程中发生错误: " + e.getMessage());
+            e.printStackTrace();
+        }
+
+        // 创建WebClient实例
+//        WebClient webClient = WebClient.create();
 //
-//            // 打开连接
-//            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+//        // 发送GET请求,获取完整响应(包括响应头)
+//        Mono<ClientResponse> responseMono = webClient.get()
+//                .uri("http://127.0.0.1/ht")
+//                .header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7")
+//                .header("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8")
+//                .header("Cache-Control", "no-cache")
+//                .header("Connection", "keep-alive")
+//                .header("Pragma", "no-cache")
+//                .header("Upgrade-Insecure-Requests", "1")
+//                .header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36")
+//                .exchangeToMono(response -> Mono.just(response));
 //
-//            // 设置请求方法为GET
-//            connection.setRequestMethod("GET");
-//            // 添加请求头
-//            for (String header : headers) {
-//                String[] parts = header.split(":", 2);
-//                if (parts.length == 2) {
-//                    connection.setRequestProperty(parts[0].trim(), parts[1].trim());
-//                }
-//            }
+//        // 阻塞获取完整响应
+//        ClientResponse response = responseMono.block();
 //
-//            // 获取响应码
-//            int responseCode = connection.getResponseCode();
-//            System.out.println("响应码: " + responseCode);
+//        if (response != null) {
+//            // 获取响应状态码
+//            System.out.println("响应状态码: " + response.statusCode());
 //
-//            // 获取所有响应头
-//            Map<String, List<String>> headersList = connection.getHeaderFields();
+//            // 获取响应头中的Cookie
+//            HttpHeaders headers = response.headers().asHttpHeaders();
+//            List<String> cookies = headers.get("Set-Cookie");
 //
-//            // 检查并获取Cookie
-//            if (headersList.containsKey("Set-Cookie")) {
-//                List<String> cookies = headersList.get("Set-Cookie");
+//            if (cookies != null && !cookies.isEmpty()) {
 //                System.out.println("获取到的Cookie:");
 //                for (String cookie : cookies) {
 //                    System.out.println(cookie);
 //                }
+//                return cookies;
 //            } else {
-//                System.out.println("响应头中没有找到Cookie");
+//                System.out.println("响应头中没有Cookie");
 //            }
 //
-//            // 关闭连接
-//            connection.disconnect();
-//
-//        } catch (IOException e) {
-//            System.err.println("请求过程中发生错误: " + e.getMessage());
-//            e.printStackTrace();
+//            // 读取响应体
+//            String responseBody = response.bodyToMono(String.class).block();
+//            System.out.println("\n响应体内容: " + responseBody);
 //        }
 
-        // 创建WebClient实例
-        WebClient webClient = WebClient.create();
-
-        // 发送GET请求,获取完整响应(包括响应头)
-        Mono<ClientResponse> responseMono = webClient.get()
-                .uri(link)
-                .header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7")
-                .header("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8")
-                .header("Cache-Control", "no-cache")
-                .header("Connection", "keep-alive")
-                .header("Pragma", "no-cache")
-                .header("Upgrade-Insecure-Requests", "1")
-                .header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36")
-                .exchangeToMono(response -> Mono.just(response));
-
-        // 阻塞获取完整响应
-        ClientResponse response = responseMono.block();
-
-        if (response != null) {
-            // 获取响应状态码
-            System.out.println("响应状态码: " + response.statusCode());
-
-            // 获取响应头中的Cookie
-            HttpHeaders headers = response.headers().asHttpHeaders();
-            List<String> cookies = headers.get("Set-Cookie");
-
-            if (cookies != null && !cookies.isEmpty()) {
-                System.out.println("获取到的Cookie:");
-                for (String cookie : cookies) {
-                    System.out.println(cookie);
-                }
-                return cookies;
-            } else {
-                System.out.println("响应头中没有Cookie");
-            }
-
-            // 读取响应体
-            String responseBody = response.bodyToMono(String.class).block();
-            System.out.println("\n响应体内容: " + responseBody);
-        }
-
         return null;
     }
 
@@ -191,13 +182,23 @@ public class HtCrawlerRequestComponent {
      * 获取请求头
      * @return
      */
-    public HttpHeaders getHeaders(String username, String password, String comcode) {
-        List<String> cookie = getCookie(username);
-        if (cookie == null || cookie.isEmpty()) {
-            cookie = authenticate(username, password, comcode, HtRequestConstant.REQUEST_NUMBER);
+    public HttpHeaders getHeaders() {
+        String cookie = getCookie();
+        if (cookie.isEmpty()) {
+            cookie = getHaTaiCookie(RequestUrl.EN_COOKIE.getRequestUrl(huaTaiCrawlerProperties.getBaseUrl()));
         }
         HttpHeaders headers = new HttpHeaders();
-        headers.add(HtRequestConstant.COOKIE, cookie.stream().collect(Collectors.joining(";")));
+        headers.add(HtRequestConstant.COOKIE, cookie);
+        headers.add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7");
+        headers.add("Accept-Language","zh-CN,zh;q=0.9,en;q=0.8");
+        headers.add("Cache-Control", "no-cache");
+        headers.add("Connection","keep-alive");
+        headers.add("Content-Type", "application/x-www-form-urlencoded");
+        headers.add("Origin", "http://172.16.100.27:9000");
+        headers.add("Pragma", "no-cache");
+        headers.add("Upgrade-Insecure-Requests", "1");
+        headers.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36");
+
         return headers;
     }
 
@@ -208,7 +209,7 @@ public class HtCrawlerRequestComponent {
      * @return
      */
     public HtCrawlerCarQueryResponse.DataDTO carQuery(HtCrawlerCarQueryRequest htCrawlerCarQueryRequest, HttpHeaders headers) throws Exception {
-        ResponseEntity<HtCrawlerCarQueryResponse> carQueryResponseEntity = requestComponent.objectPost(RequestUrl.CAR_QUERY.getRequestUrl(huaTaiCrawlerProperties.getBaseUrl()), htCrawlerCarQueryRequest, HtCrawlerCarQueryResponse.class, headers);
+        ResponseEntity<HtCrawlerCarQueryResponse> carQueryResponseEntity = requestComponent.objectPost(RequestUrl.NE_CAR_QUERY.getRequestUrl(huaTaiCrawlerProperties.getBaseUrl()), htCrawlerCarQueryRequest, HtCrawlerCarQueryResponse.class, headers);
         HtCrawlerCarQueryResponse carQueryResponse = carQueryResponseEntity.getBody();
         String decryptKey = HuaTaiCryptUtil.RSADecrypt(carQueryResponse.getAccessToken());
         String decryptData = HuaTaiCryptUtil.AESDecrypt(carQueryResponse.getData(), decryptKey);

+ 37 - 0
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/component/HuaTaiCrawlerCacheComponent.java

@@ -0,0 +1,37 @@
+package com.jzg.quotation.huatai.crawler.component;
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.redisson.api.RMap;
+import org.redisson.api.RedissonClient;
+import org.springframework.stereotype.Component;
+
+import java.time.Duration;
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+@Component
+@RequiredArgsConstructor
+public class HuaTaiCrawlerCacheComponent {
+
+    private final RedissonClient redissonClient;
+
+    public static final String HUATAI_COOKIE = "huatai:cookie:";
+
+    public static final String COOKIE = "Cookie:";
+
+    public void cacheCookie(String cookie) {
+        Map<String, String> authorizationMap = new HashMap<>();
+
+        authorizationMap.put(COOKIE, cookie);
+        RMap<Object, Object> map = redissonClient.getMap(HUATAI_COOKIE);
+        map.putAll(authorizationMap);
+        map.expire(Duration.ofHours(3L));
+    }
+
+    public String getCookie() {
+        return (String) redissonClient.getMap(HUATAI_COOKIE).get(COOKIE);
+    }
+
+}

+ 18 - 11
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/constant/enums/RequestUrl.java

@@ -13,23 +13,30 @@ import lombok.Getter;
 @Getter
 public enum RequestUrl implements CrawlerRequestUrlStandard {
 
-    COOKIE("/htcsp/", "获取cookie"),
-    AUTHENTICATE("/htcsp/ShakeHandsAction.do?cmd=loginWelcom", "登录"),
+    EN_COOKIE("/htcsp", "获取cookie"),
+    COOKIE("http://172.16.100.37:9999/htcsp", "获取cookie"),
+    NE_AUTHENTICATE("/login", "登录"),
+    AUTHENTICATE("http://172.16.100.37:9999/htcsp/ShakeHandsAction.do?cmd=loginWelcom", "登录"),
 
-    CAR_QUERY("/htcsp/VehicleInfoEntryAction.do?cmd=carquery", "车型查询"),
-    SAVE_ONE_STEP("/htcsp/VehicleInfoEntryAction.do?cmd=saveOneStept", "保存车辆信息和车主等信息"),
-    QUOTE_PRICE("/htcsp/VehicleInfoEntryAction.do?cmd=carquery", "报价"),
+    NE_CAR_QUERY("/carquery", "车型查询"),
+    CAR_QUERY("http://172.16.100.37:9999/htcsp/VehicleInfoEntryAction.do?cmd=carquery", "车型查询"),
 
-    GET_UPLOAD_URL("/htcsp/UploadAction.do?cmd=getUploadUrl", "获取影像上传路径"),
-    UPLOAD("/app/ImgFileUpload/upload.do", "影像上传"),
+    NE_SAVE_ONE_STEP("/saveOneStept", "保存车辆信息和车主等信息"),
+    SAVE_ONE_STEP("http://172.16.100.37:9999/htcsp/VehicleInfoEntryAction.do?cmd=saveOneStept", "保存车辆信息和车主等信息"),
 
-    SUBMIT("/htcsp/checkInsAction.do?cmd=submit4ajax&SS=SS", "提交核保"),
+    NE_QUOTE_PRICE("/quotation", "报价"),
+    QUOTE_PRICE("http://172.16.100.37:9999/htcsp/VehicleInfoEntryAction.do?cmd=carquery", "报价"),
 
-    ORDER_STATE("/htcsp/QuotationQueryAction.do?cmd=quotationListAll", "查询订单状态"),
+    GET_UPLOAD_URL("http://172.16.100.37:9999/htcsp/UploadAction.do?cmd=getUploadUrl", "获取影像上传路径"),
+    UPLOAD("http://172.16.100.37:9999/app/ImgFileUpload/upload.do", "影像上传"),
 
-    PAYMENT_LINK("/htcsp/PaymentAction.do?cmd=Sendelectronicprop", "获取支付链接"),
+    SUBMIT("http://172.16.100.37:9999/htcsp/checkInsAction.do?cmd=submit4ajax&SS=SS", "提交核保"),
 
-    DOWNLOAD_POLICY("/htcsp/DocumentPrintAction.do?cmd=electronicPolicyEndorseDownload", "下载保单"),
+    ORDER_STATE("http://172.16.100.37:9999/htcsp/QuotationQueryAction.do?cmd=quotationListAll", "查询订单状态"),
+
+    PAYMENT_LINK("http://172.16.100.37:9999/htcsp/PaymentAction.do?cmd=Sendelectronicprop", "获取支付链接"),
+
+    DOWNLOAD_POLICY("http://172.16.100.37:9999/htcsp/DocumentPrintAction.do?cmd=electronicPolicyEndorseDownload", "下载保单"),
     ;
 
     private final String url;

+ 6 - 7
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/service/Impl/HuaTaiCrawlerRequestImpl.java

@@ -21,7 +21,6 @@ import com.jzg.quotation.huatai.crawler.entity.Request.*;
 import com.jzg.quotation.huatai.crawler.entity.Response.*;
 import com.jzg.quotation.huatai.crawler.entity.dto.LoginDTO;
 import com.jzg.quotation.huatai.crawler.entity.po.HtCrawlerOrder;
-import com.jzg.quotation.huatai.crawler.entity.vo.LoginVPNResult;
 import com.jzg.quotation.huatai.crawler.service.HtCrawlerOrderService;
 import com.jzg.quotation.huatai.crawler.service.HuaTaiCrawlerRequest;
 import lombok.RequiredArgsConstructor;
@@ -94,7 +93,7 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
         AttributionInformationVo attributionInformationVo = quoteVo.getOrder().getAttributionInformationVo();
         //获取配置信息
         HtCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(HtCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
-        HttpHeaders headers = htCrawlerRequestComponent.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword(), parameters.getComCode());
+        HttpHeaders headers = htCrawlerRequestComponent.getHeaders();
         HtCrawlerCarQueryRequest carQueryRequest = new HtCrawlerCarQueryRequest(carInfoVo);
         HtCrawlerCarQueryResponse.DataDTO dataDTO = null;
         try {
@@ -137,7 +136,7 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
         AttributionInformationVo attributionInformationVo = underwritingVo.getOrder().getAttributionInformationVo();
         //获取配置信息
         HtCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(HtCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
-        HttpHeaders headers = htCrawlerRequestComponent.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword(), parameters.getComCode());
+        HttpHeaders headers = htCrawlerRequestComponent.getHeaders();
 
         HtCrawlerSubmitRequest  htCrawlerSubmitRequest = new HtCrawlerSubmitRequest(underwritingVo, parameters);
         HtCrawlerSubmitResponse htCrawlerSubmitResponse = htCrawlerRequestComponent.submit(htCrawlerSubmitRequest, headers);
@@ -154,7 +153,7 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
         AttributionInformationVo attributionInformationVo = paymentLinkVo.getOrder().getAttributionInformationVo();
         //获取配置信息
         HtCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(HtCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
-        HttpHeaders headers = htCrawlerRequestComponent.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword(), parameters.getComCode());
+        HttpHeaders headers = htCrawlerRequestComponent.getHeaders();
 
         HtCrawlerPaymentLinkRequest htCrawlerPaymentLinkRequest = new HtCrawlerPaymentLinkRequest(parameters, paymentLinkVo);
         HtCrawlerPaymentLinkResponse paymentLinkResponse = htCrawlerRequestComponent.getPaymentLink(htCrawlerPaymentLinkRequest, headers);
@@ -172,7 +171,7 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
         AttributionInformationVo attributionInformationVo = orderBase.getAttributionInformationVo();
         //获取配置信息
         HtCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(HtCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
-        HttpHeaders headers = htCrawlerRequestComponent.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword(), parameters.getComCode());
+        HttpHeaders headers = htCrawlerRequestComponent.getHeaders();
 
         HtCrawlerOrder htCrawlerOrder = htCrawlerOrderService.findByOrdersNo(orderBase.getOrdersNo());
         String quotationRelaNo = htCrawlerOrder.getQuotationRelaNo();
@@ -219,7 +218,7 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
         AttributionInformationVo attributionInformationVo = downloadPolicyVo.getOrder().getAttributionInformationVo();
         //获取配置信息
         HtCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(HtCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
-        HttpHeaders headers = htCrawlerRequestComponent.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword(), parameters.getComCode());
+        HttpHeaders headers = htCrawlerRequestComponent.getHeaders();
 
         HtCrawlerDownloadPolicyRequest downloadPolicyRequest = new HtCrawlerDownloadPolicyRequest();
         HtCrawlerDownloadPolicyResponse htCrawlerDownloadPolicyResponse = htCrawlerRequestComponent.downloadPolicy(downloadPolicyRequest, headers);
@@ -236,7 +235,7 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
         AttributionInformationVo attributionInformationVo = orderStatusVo.getOrder().getAttributionInformationVo();
         //获取配置信息
         HtCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(HtCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
-        HttpHeaders headers = htCrawlerRequestComponent.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword(), parameters.getComCode());
+        HttpHeaders headers = htCrawlerRequestComponent.getHeaders();
 
         HtCrawlerOrder htCrawlerOrder = htCrawlerOrderService.findByOrdersNo(orderStatusVo.getOrder().getOrdersNo());
         String quotationRelaNo = htCrawlerOrder.getQuotationRelaNo();

+ 1 - 1
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/util/HuaTaiCryptUtil.java

@@ -351,7 +351,7 @@ public class HuaTaiCryptUtil {
      * @return
      * @throws Exception
      */
-    public static String RSAEncrypt(String base64Text) throws Exception {
+    public static String                                                                                                                          RSAEncrypt(String base64Text) throws Exception {
         // 计算最大块长度(字节)
         if (base64Text.length() > MAX_LENGTH_ENCRYPT) {
             List<String> blocks = splitIntoBlocks(base64Text, BLOCK_SIZE_ENCRYPT);