فهرست منبع

华农登录修改

wanghao 4 ماه پیش
والد
کامیت
28cb38ddb1

+ 1 - 1
tenant/insurance/quotation-huanong/src/main/java/com/jzg/quotation/huanong/crawler/component/HuaNongCrawlerCacheComponent.java

@@ -26,7 +26,7 @@ public class HuaNongCrawlerCacheComponent {
     // 授权信息
     public static final String AUTHORIZATION = "hunong:crawler:authorization:";
 
-    public static final long AUTHORIZATION_TIME = 3L;
+    public static final long AUTHORIZATION_TIME = 1L;
 
     public static final String TOKEN = "TOKEN";
 

+ 2 - 2
tenant/insurance/quotation-huanong/src/main/java/com/jzg/quotation/huanong/crawler/service/impl/HuaNongCrawlerGetTokenImpl.java

@@ -43,9 +43,9 @@ public class HuaNongCrawlerGetTokenImpl implements HuaNongCrawlerGetToken {
                               Predicate<T> validator) {
         try {
             T data = cacheSupplier.get();
-            /*if (validator.test(data)) {
+            if (validator.test(data)) {
                 return data;
-            }*/
+            }
             huaNongCrawlerQuoteProcessService.login(username, password,deviceId, false);
             T newData = cacheSupplier.get();
             if (!validator.test(newData)) {

+ 4 - 4
tenant/insurance/quotation-huanong/src/main/java/com/jzg/quotation/huanong/crawler/service/impl/HuaNongCrawlerQuoteProcessServiceImpl.java

@@ -151,14 +151,14 @@ public class HuaNongCrawlerQuoteProcessServiceImpl implements HuaNongCrawlerQuot
 
     private void authorization(String username, String password,String deviceId, boolean isFirst) {
         // 判断是否在首次登录(协议、账号)
-        if (!isFirst) {
+        /*if (!isFirst) {
             huaNongCrawlerCacheComponent.isAccountLockout(username);
-        }
+        }*/
         HuaNongCrawlerLoginResponse login = attemptLoginWithRetry(username, password,deviceId);
         // 判断是否在首次登录(协议、账号)
-        if (!isFirst) {
+        /*if (!isFirst) {
             huaNongCrawlerCacheComponent.accountLockout(username);
-        }
+        }*/
        /* String s = extractErrorMessage(login);
         throw new SystemException(s);*/
     }