Browse Source

增加 launchScene 的逻辑判断

dodo hold 1 year ago
parent
commit
ad71df2bf8

File diff suppressed because it is too large
+ 0 - 0
molilian.api/Properties/PublishProfiles/latest.pubxml.user


+ 1 - 1
molilian.core/Core/jd/JdPoolCore.cs

@@ -78,7 +78,7 @@ namespace molilian.core
 
             if ("brw".Equals(riskStrategy) && launchScene != 0)
             {
-                list = list.Where(item => "brw".Equals(item.riskStrategy)).ToList();
+                list = list.Where(item => "brw".Equals(item.riskStrategy) && item.launchScene == launchScene).ToList();
                 if (!list.Any()) return null;
             }
             else

+ 1 - 1
molilian.core/Core/taoke/TkPoolCore.cs

@@ -66,7 +66,7 @@ namespace molilian.core
 
             if ("brw".Equals(riskStrategy) && launchScene != 0)
             {
-                list = list.Where(item => "brw".Equals(item.riskStrategy)).ToList();
+                list = list.Where(item => "brw".Equals(item.riskStrategy) && item.launchScene == launchScene).ToList();
                 if (!list.Any()) return null;
             }
             else

+ 1 - 0
molilian.core/DTO/alimama/TkPoolDTO.cs

@@ -65,6 +65,7 @@
         /// brw-浏览器,qapp-快应用
         /// </summary>
         public string riskStrategy { get; set; } = string.Empty;
+        public int launchScene { get; set; } = 0;
         public bool useCouponLinkFirst { get; set; } = true;
 
     }

+ 1 - 0
molilian.core/DTO/jd/JdPoolDTO.cs

@@ -58,6 +58,7 @@
         public bool other_api_non_numeric_required { get; set; } = true;
         public string riskStrategy { get; set; } = string.Empty;
 
+        public int launchScene { get; set; } = 0;
 
 
     }

+ 13 - 1
molilian.core/Plus/Alimama/orders.cs

@@ -434,6 +434,7 @@ SET  order_ord_num = order_ord_num_3 + order_ord_num_12 + order_ord_num_13 + ord
                 JsonElement data;
                 try
                 {
+                    bool success = false;
                     for (var i = 1; i <= 5; i++)
                     {
                         var client = new WebClientUtility().SetContentType("application/json;charset=utf-8")
@@ -460,6 +461,17 @@ SET  order_ord_num = order_ord_num_3 + order_ord_num_12 + order_ord_num_13 + ord
 #if DEBUG
 #endif
 
+                        if (body.Contains("{\"action\":\"login\""))
+                        {
+                            (success, string message) = RenewCookie();
+                            if (!success)
+                            {
+                                TkPoolCore.Disabled(_accountId, _accountName, $"{body}");
+                            }
+                            return (0, DateTime.MinValue, new List<DateTime>());
+                        }
+
+
                         if (body.Contains("{\"action\":\"captcha\""))
                         {
                             string message = $"【GetTkOrders】【{_accountId}:{_accountName}】第 {i} 次出现滑动验证码";
@@ -493,7 +505,7 @@ SET  order_ord_num = order_ord_num_3 + order_ord_num_12 + order_ord_num_13 + ord
                     /*
 <script>sessionStorage.x5referer = window.location.href;var url = window.location.protocol + "//pub.alimama.com//openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json/_____tmd_____/punish?x5secdata=xc1iwR0XfHknuQ2tGhtadtTAvEt14YScfTDHt2ZiSRqroaYZK98uykgsVOy7o75Rw8uuycKT3Rpx30%2fB5H0gRc0%2fJVGQUcV5g%2fsAmZ%2bc46eyD7DXSdA4R3mLnmtbp9wuZ1vmrG3ZPlH7brUilFbXBdZ7EBrru1X7wPfC05Eq3g4mhDFiGq39xUtwQcC%2f%2bPbtekcm8%2fVJ%2brVt8aExunwzXzJPJJTAvEt14YScfTDHt2ZiSRqroaYZK98uykgsiXIkw%2ffMWwebJ3zxCja5CzSu%2ffTA%3d%3d__bx__pub.alimama.com%2fopenapi%2fparam2%2f1%2fgateway.unionpub%2freport.getTbkOrderDetails.json&x5step=1";window.location.replace(url);window._config_ = {"action":"captcha","url":"https://pub.alimama.com//openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json/_____tmd_____/punish?x5secdata=xc1iwR0XfHknuQ2tGhtadtTAvEt14YScfTDHt2ZiSRqroaYZK98uykgsVOy7o75Rw8uuycKT3Rpx30%2fB5H0gRc0%2fJVGQUcV5g%2fsAmZ%2bc46eyD7DXSdA4R3mLnmtbp9wuZ1vmrG3ZPlH7brUilFbXBdZ7EBrru1X7wPfC05Eq3g4mhDFiGq39xUtwQcC%2f%2bPbtekcm8%2fVJ%2brVt8aExunwzXzJPJJTAvEt14YScfTDHt2ZiSRqroaYZK98uykgsiXIkw%2ffMWwebJ3zxCja5CzSu%2ffTA%3d%3d__bx__pub.alimama.com%2fopenapi%2fparam2%2f1%2fgateway.unionpub%2freport.getTbkOrderDetails.json&x5step=1"};</script><!--rgv587_flag:sm-->                     */
                     var root = body.Convert2JsonElement();
-                    var success = root.Read<bool>("success");
+                    success = root.Read<bool>("success");
                     data = root.ElementRead("data");
 
 

Some files were not shown because too many files changed in this diff