Ver código fonte

转链和订单匹配、获取转化订单的API

dodo hold 2 anos atrás
pai
commit
0e04541763

+ 2 - 2
molilian.api/Controllers/public/TaskController.cs

@@ -81,7 +81,7 @@ namespace molilian.api.Controllers
                 }
                 catch (Exception ex)
                 {
-                    message = $"【订单接口异常】\t{account.name}\n{ex.Message}\n{ex.StackTrace}";
+                    message = $"【订单接口异常】[{account.id}]{account.company}\n{ex.Message}\n{ex.StackTrace}";
                     NotifyCore.Notify(new NifyMessage
                     {
                         message = message,
@@ -114,7 +114,7 @@ namespace molilian.api.Controllers
                 }
                 catch (Exception ex)
                 {
-                    message = $"【订单接口异常】\t{account.name}\n{ex.Message}\n{ex.StackTrace}";
+                    message = $"【订单接口异常】[{account.id}]{account.company}\n{ex.Message}\n{ex.StackTrace}";
                     NotifyCore.Notify(new NifyMessage
                     {
                         message = message,

+ 47 - 27
molilian.api/Controllers/public/TkController.cs

@@ -8,6 +8,7 @@ using System.Net;
 using System.Security.Cryptography;
 using Microsoft.AspNetCore.Authentication;
 using TencentCloud.Ecm.V20190719.Models;
+using COSXML.Network;
 
 namespace molilian.api.Controllers
 {
@@ -500,8 +501,9 @@ namespace molilian.api.Controllers
         [HttpGet]
         public async Task<ActionResult> dplist([FromQuery] string query = "", [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
         {
-            query = "";
+#if DEBUG
 
+#else
             //验证签名
             if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
             {
@@ -525,45 +527,63 @@ namespace molilian.api.Controllers
                 return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
             }
 
-            List<object> list = [];
-
-            Random rand = new Random();
-            if (rand.Next(0, 10) > 1)
+            if (string.IsNullOrEmpty(query))
             {
-                list =
-                [
-                    new
-                {
-                    url = "tbopen://m.taobao.com/tbopen/index.html?action=ali.open.nav&module=h5&h5Url=https%3A%2F%2Fs.click.taobao.com%2FgRtQClt&backURL=__back_url__",
-                    count = 1,
-                    time = DateTime.Now,
-                },
-                new
-                {
-                    url = "tbopen://m.taobao.com/tbopen/index.html?action=ali.open.nav&module=h5&h5Url=https%3A%2F%2Fs.click.taobao.com%2FDZLLYkt&backURL=__back_url__",
-                    count = 1,
-                    time = DateTime.Now,
-                },
-                new
-                {
-                    url = "tbopen://m.taobao.com/tbopen/index.html?action=ali.open.nav&module=h5&h5Url=https%3A%2F%2Fs.click.taobao.com%2FtLVLYkt&backURL=__back_url__",
-                    count = 1,
-                    time = DateTime.Now,
-                },
-            ];
+                return new APIResult(new { success = false, message = "查询条件不能为空" });
+            }
+#endif
+
+            string filter = $"batchId=@query";
+            string orderBy = "paid_time ASC";
 
+            var data = new DBContext.Table("tk_order_tracking")
+                .Where(filter, new { query })
+                .Order(orderBy)
+                .Select<TkOrderTrackingDTO>();
+
+            List<object> list = new();
+            foreach (var item in data)
+            {
+                list.Add(new { url = item.deeplinkUrl, count = 1, time = item.exp_time });
             }
 
             return new APIResult(new
             {
                 success = true,
                 message = list.Count == 0 ? "none" : "ok",
+                count = list.Count,
                 data = list,
             });
-
         }
 
+         
+
+
+
+        [HttpGet]
+        public async Task<ActionResult> unsafeParseDpList([FromQuery] string query = "", [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
+        {
+            string filter = $"batchId=@query";
+            string orderBy = "paid_time ASC";
+
+            var data = new DBContext.Table("tk_order_tracking")
+                .Where(filter, new { query })
+                .Order(orderBy)
+                .Select<TkOrderTrackingDTO>();
 
+            List<object> list = new();
+            foreach (var item in data)
+            {
+                list.Add(new { url = item.deeplinkUrl, count = 1, time = item.exp_time });
+            }
 
+            return new APIResult(new
+            {
+                success = true,
+                message = list.Count == 0 ? "none" : "ok",
+                count = list.Count,
+                data = list,
+            });
+        }
     }
 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1
molilian.api/Properties/PublishProfiles/https___ccr.ccs.tencentyun.com_shaobin.pubxml.user


+ 1 - 0
molilian.api/Properties/launchSettings.json

@@ -6,6 +6,7 @@
       "launchUrl": "swagger",
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development",
+        "EndPoint": "gz",
         "NtfyServer": "https://ntfy.yunhui800.com/5Sq9BytXXM5WDY3G",
         "ANPush": "",
         "DBType": "MySQL",

+ 86 - 0
molilian.core/Core/taoke/OrderTrackingCore.cs

@@ -0,0 +1,86 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc.Controllers;
+using Microsoft.AspNetCore.Mvc.Filters;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using dodohold.core;
+using Dataoke;
+using Google.Protobuf.WellKnownTypes;
+using System.Diagnostics;
+using System.Text.Json;
+using TencentCloud.Tcm.V20210413.Models;
+using System.Security.Cryptography;
+using System.Data;
+
+
+namespace molilian.core
+{
+    public partial class TkOrderTrackingCore
+    {
+        public static void SaveLinkSummary(TkDataDTO item)
+        {
+            string cacheKey = $":cache:order_summary:{item.accountName}:{item.itemId}";
+            RedisHelper.Set(cacheKey, item, 86400);
+
+            cacheKey = $":cache:order_summary:{item.accountName}:{item.itemName}";
+            RedisHelper.Set(cacheKey, item, 86400);
+        }
+        public static TkDataDTO GetLinkSummary(string accountName, string name)
+        {
+            string cacheKey = $":cache:order_summary:{accountName}:{name}";
+            return RedisHelper.Get<TkDataDTO>(cacheKey);
+        }
+        public static void RemoveLinkSummary(string accountName, string itemId)
+        {
+            string cacheKey = $":cache:order_summary:{accountName}:{itemId}";
+            RedisHelper.Del(cacheKey);
+        }
+
+        public static bool MatchOrder(TkOrderDetailDTO item, IDbConnection conn)
+        {
+            if (item.tbPaidTime < DateTime.Now.AddDays(-1)) return false;
+
+            var summary = GetLinkSummary(item.accountName, item.itemTitle);
+            if (summary == null) return false;
+
+
+            DateTime paidTime = item.tbPaidTime;
+            if (paidTime < summary.create_time) return false;
+
+            int minutes = paidTime.Minute / 10 * 10;
+            DateTime rounded = new(paidTime.Year, paidTime.Month, paidTime.Day, paidTime.Hour, minutes, 0);
+            string batchId = rounded.ToString("yyyyMMddHHmm");
+
+            DateTime expTime = item.tbPaidTime.Hour >= 21 ? item.tbPaidTime.AddHours(3) : item.tbPaidTime.Date.AddDays(1);
+            var data = new TkOrderTrackingDTO()
+            {
+                channel = summary.channel,
+                accountId = item.accountId,
+                accountName = item.accountName,
+                batchId = batchId,
+                ip = summary.ip,
+                oaid = summary.oaid,
+                itemId = summary.itemId,
+                itemName = summary.itemName,
+                taoToken = summary.taoToken,
+                shortLinkUrl = summary.shortLinkurl,
+                deeplinkUrl = summary.deeplink_url,
+
+                tradeId = item.tradeId,
+                tradeParentId = item.tradeParentId,
+
+                create_time = summary.create_time,
+                click_time = item.clickTime,
+                paid_time = item.tbPaidTime,
+
+                exp_time = expTime,
+            };
+
+            conn.Replace(data);
+            RemoveLinkSummary(item.accountName, item.itemTitle);
+            return true;
+        }
+    }
+}

+ 19 - 23
molilian.core/Core/taoke/TkLogCore.cs

@@ -38,8 +38,7 @@ namespace molilian.core
                 {
                     var data = RedisHelper.LPop<TkDataDTO>(queue_tb_key);
                     if (data == null) break;
-
-                    new DBContext.Table(connection, "tk_logs")
+                    data.id = new DBContext.Table(connection, "tk_logs")
                         .Add("channel", (int)data.channel)
                         .Add("accountName", data.accountName)
                         .Add("rawContent", data.rawContent)
@@ -62,28 +61,28 @@ namespace molilian.core
                         .Add("oaid", data.oaid)
                         .Add("create_time", data.create_time)
                         .Create(DBContext.InsertType.NORMAL, transaction);
+                    if (!string.IsNullOrEmpty(data.itemId)) TkOrderTrackingCore.SaveLinkSummary(data);
                 }
 
                 for (int i = 0; i < 100; i++)
                 {
                     var data = RedisHelper.LPop<JdDataDTO>(queue_jd_key);
                     if (data == null) break;
-
                     new DBContext.Table(connection, "tk_logs")
-                        .Add("channel", (int)data.channel)
-                        .Add("accountName", data.accountName)
-                        .Add("rawContent", data.rawContent)
-                        .Add("rawContent2", data.rawContent2)
-                        .Add("success", data.success)
-                        .Add("message", data.message)
-                        .Add("reason", data.reason)
-                        .Add("shortLinkurl", data.shortLinkurl)
-                        .Add("deeplink_url", data.deeplink_url)
-                        .Add("elapsedTime", data.elapsedTime)
-                        .Add("ip", data.ip)
-                        .Add("oaid", data.oaid)
-                        .Add("create_time", data.create_time)
-                        .Create(DBContext.InsertType.NORMAL, transaction);
+                       .Add("channel", (int)data.channel)
+                       .Add("accountName", data.accountName)
+                       .Add("rawContent", data.rawContent)
+                       .Add("rawContent2", data.rawContent2)
+                       .Add("success", data.success)
+                       .Add("message", data.message)
+                       .Add("reason", data.reason)
+                       .Add("shortLinkurl", data.shortLinkurl)
+                       .Add("deeplink_url", data.deeplink_url)
+                       .Add("elapsedTime", data.elapsedTime)
+                       .Add("ip", data.ip)
+                       .Add("oaid", data.oaid)
+                       .Add("create_time", data.create_time)
+                       .Create(DBContext.InsertType.NORMAL, transaction);
                 }
 
                 for (int i = 0; i < 100; i++)
@@ -91,7 +90,7 @@ namespace molilian.core
                     var data = RedisHelper.LPop<TkDataDTO>(queue_parse_tb_key);
                     if (data == null) break;
 
-                    new DBContext.Table(connection, "tk_parse_logs")
+                    data.id = new DBContext.Table(connection, "tk_parse_logs")
                         .Add("channel", (int)data.channel)
                         .Add("accountName", data.accountName)
                         .Add("rawContent", data.rawContent)
@@ -113,13 +112,13 @@ namespace molilian.core
                         .Add("oaid", data.oaid)
                         .Add("create_time", data.create_time)
                         .Create(DBContext.InsertType.NORMAL, transaction);
+                    if (!string.IsNullOrEmpty(data.itemId)) TkOrderTrackingCore.SaveLinkSummary(data);
                 }
 
                 for (int i = 0; i < 100; i++)
                 {
                     var data = RedisHelper.LPop<JdDataDTO>(queue_parse_jd_key);
                     if (data == null) break;
-
                     new DBContext.Table(connection, "tk_parse_logs")
                         .Add("channel", (int)data.channel)
                         .Add("accountName", data.accountName)
@@ -146,7 +145,6 @@ namespace molilian.core
                 {
                     var data = RedisHelper.LPop<DyDataDTO>(queue_parse_dy_key);
                     if (data == null) break;
-
                     new DBContext.Table(connection, "tk_parse_logs")
                         .Add("channel", (int)data.channel)
                         .Add("accountName", data.accountName)
@@ -173,7 +171,6 @@ namespace molilian.core
                 {
                     var data = RedisHelper.LPop<ToolParseDataDTO>(queue_parse_tool_key);
                     if (data == null) break;
-
                     new DBContext.Table(connection, "tool_parse_logs")
                         .Add("channel", (int)data.channel)
                         .Add("rawContent", data.rawContent)
@@ -275,6 +272,7 @@ namespace molilian.core
                 response.elapsedTime = (int)ts.TotalMilliseconds;
                 RedisHelper.RPush(queue_parse_tb_key, response);
                 saveCache(response.channel.ToString(), response.accountName, response.success, response.message, response.reason);
+                if (!string.IsNullOrEmpty(response.itemId)) TkOrderTrackingCore.SaveLinkSummary(response);
 
                 if (!response.success && "nologin".Equals(response.message))
                 {
@@ -513,8 +511,6 @@ namespace molilian.core
                 }
             });
         }
-
-
         private static void saveCache(string channel, string accountName, bool success, string message, string reason)
         {
             saveAccountCache("all", success, message, reason);

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

@@ -20,9 +20,6 @@ namespace molilian.core
         static TkPoolCore()
         {
             _end_point = Environment.GetEnvironmentVariable("EndPoint");
-#if DEBUG
-            _end_point = "zz";
-#endif
         }
 
         private static readonly object _lockObj = new();
@@ -63,6 +60,9 @@ namespace molilian.core
         }
         private static bool IsNotExceedDailyIncomeLimit(TkPoolDTO item)
         {
+#if DEBUG
+            if (item.id != 13) return false;
+#endif
             if (!string.IsNullOrEmpty(_end_point) && !string.IsNullOrEmpty(item.end_point))
             {
                 if (item.end_point != _end_point) return false;

+ 2 - 0
molilian.core/DTO/alimama/TkDataDTO.cs

@@ -4,6 +4,8 @@ namespace molilian.core
 {
     public class TkDataDTO
     {
+        [Key]
+        public int id { get; set; }
         public TkChannelEnum channel { get; set; }
         public LinkTypeEnum link_type { get; set; }
         public ChannelTypeEnum channel_type { get; set; } = ChannelTypeEnum.none;

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

@@ -224,6 +224,7 @@ namespace molilian.core
         /// 商品图片
         /// </summary>
         public string itemImg { get; set; } = string.Empty;
+        public string itemId { get; set; } = string.Empty;
 
         /// <summary>
         /// 订单角色文本

+ 32 - 0
molilian.core/DTO/alimama/TkOrderTrackingDTO.cs

@@ -0,0 +1,32 @@
+using dodohold.core;
+using System.Security.Cryptography;
+using System.Text.Json.Serialization;
+
+namespace molilian.core
+{
+
+    [Table("tk_order_tracking")]
+    public class TkOrderTrackingDTO
+    {
+        [Key]
+        public int Id { get; set; }
+        public TkChannelEnum channel { get; set; }
+        public int accountId { get; set; } = 0;
+        public string accountName { get; set; } = string.Empty;
+        public string batchId { get; set; } = string.Empty;
+        public string ip { get; set; } = string.Empty;
+        public string oaid { get; set; } = string.Empty;
+        public string itemId { get; set; } = string.Empty;
+        public string itemName { get; set; } = string.Empty;
+        public string taoToken { get; set; } = string.Empty;
+        public string shortLinkUrl { get; set; } = string.Empty;
+        public string deeplinkUrl { get; set; } = string.Empty;
+        public string tradeId { get; set; } = string.Empty;
+        public string tradeParentId { get; set; } = string.Empty;
+        public DateTime create_time { get; set; } = DateTime.Now;
+        public DateTime exp_time { get; set; } = DateTime.Now;
+        public DateTime click_time { get; set; } = DateTime.MinValue;
+        public DateTime paid_time { get; set; } = DateTime.MinValue;
+    }
+
+}

+ 100 - 17
molilian.core/Plus/Alimama/orders.cs

@@ -3,6 +3,7 @@ using Spire.Pdf.Xmp;
 using System.Data;
 using System.Drawing.Printing;
 using System.Text.Json;
+using System.Text.RegularExpressions;
 
 namespace molilian.core
 {
@@ -26,31 +27,43 @@ namespace molilian.core
             //}
 
             //当日往前查询
-            return GetTkOrders(startTime, endTime, DateTime.MinValue, false, sleep);
+            (int total, _) = GetTkOrders(startTime, endTime, DateTime.MinValue, false, sleep);
+            return total;
+
         }
         public int GetIncyOrders(int sleep)
         {
+            string cacheKey = $":cache:GetIncyOrders:{_accountName}";
             DateTime endTime = DateTime.Now;
             DateTime startTime = endTime.AddDays(-1);
 
-            //找出数据库最新的一天
-            var last = new DBContext.Table("tk_order_details")
-                 .Order("modifiedTime DESC")
-                 .Get<TkOrderDetailDTO>("accountId=@accountId", new { accountId = _accountId });
+
+            DateTime last_modifiedTime = RedisHelper.Get<DateTime>(cacheKey);
+            ////找出数据库最新的一天
+            //var last = new DBContext.Table("tk_order_details")
+            //     .Order("modifiedTime DESC")
+            //     .Get<TkOrderDetailDTO>("accountId=@accountId", new { accountId = _accountId });
 
 
-            DateTime last_modifiedTime = DateTime.MinValue;
-            if (last != null)
+            if (last_modifiedTime != DateTime.MinValue)
+            {
+                startTime = last_modifiedTime;
+            }
+            else
             {
-                startTime = last.modifiedTime;
-                last_modifiedTime = last.modifiedTime;
+                last_modifiedTime = startTime;
             }
 
             //当日往前查询
-            return GetTkOrders(startTime, endTime, last_modifiedTime, true, sleep);
+            (int total, DateTime max_modifiedTime) = GetTkOrders(startTime, endTime, last_modifiedTime, true, sleep);
+            if (max_modifiedTime != DateTime.MinValue)
+            {
+                RedisHelper.Set(cacheKey, max_modifiedTime);
+            }
+            return total;
         }
 
-        public int GetTkOrders(DateTime startTime, DateTime endTime, DateTime last_modifiedTime, bool desc = true, int sleep = 100)
+        public (int, DateTime) GetTkOrders(DateTime startTime, DateTime endTime, DateTime last_modifiedTime, bool desc = true, int sleep = 100)
         {
             // 确保 startTime 小于 endTime
             if (startTime > endTime)
@@ -58,9 +71,11 @@ namespace molilian.core
                 (startTime, endTime) = (endTime, startTime);
             }
 
+            DateTime max_modifiedTime = last_modifiedTime;
+
             int pageNo = 1;
             string positionIndex = string.Empty;
-            int pageSize = 20;
+            int pageSize = 100;
 
             bool hasNext = true;
             int total = 0;
@@ -118,13 +133,21 @@ namespace molilian.core
                         item.accountId = _accountId;
                         item.accountName = _accountName;
 
-                        if (last_modifiedTime != DateTime.MinValue && last_modifiedTime.AddMinutes(-2) >= item.modifiedTime)
+                        if (item.modifiedTime > max_modifiedTime) max_modifiedTime = item.modifiedTime;
+
+                        if (last_modifiedTime != DateTime.MinValue && last_modifiedTime >= item.modifiedTime)
                         {
-                            return total;
+                            return (total, max_modifiedTime);
                         }
-
+                        //进行订单和转链匹配
+                        //string mktItemLink = $"https:{item.mktItemLink}";
+                        //item.itemId = GetRawItemId(mktItemLink);
                         int? id = conn.Replace(item);
-
+                        if (id != null)
+                        {
+                            item.id = (int)id;
+                            TkOrderTrackingCore.MatchOrder(item, conn);
+                        }
                         total++;
                     }
                 }
@@ -142,10 +165,70 @@ namespace molilian.core
 
                 if (sleep > 0) Thread.Sleep(sleep);
             }
-            return total;
+            return (total, max_modifiedTime);
         }
 
 
+        string GetRawItemId(string url)
+        {
+            try
+            {
+
+                string cacheKey = $":cache:url2itemId:{url}";
+
+                string itemId = RedisHelper.Get(cacheKey);
+                if (itemId != null) return itemId;
+
+                WebClientUtility client = new()
+                {
+                    Proxy = _proxy,
+                    UserAgent = Sayaka.Common.ProviderFakeUserAgent.RandomComputer
+                };
+#if DEBUG
+                client.Proxy = null;
+#endif
+                client.AllowAutoRedirect = false;
+                var response = client.Request(url);
+                if (response.Successed)
+                {
+                    string location = response.ResponseMessage?.Headers?.Location?.ToString();
+                    if (!string.IsNullOrEmpty(location))
+                    {
+                        itemId = location.GetContentPart("id=", "");
+                        if (!string.IsNullOrEmpty(itemId))
+                        {
+                            RedisHelper.Set(cacheKey, itemId, 86400 * 30);
+                        }
+                        return itemId;
+                    }
+                    var responseBody = response.Body();
+                    if (response.ResponseMessage.IsSuccessStatusCode)
+                    {
+                        throw new APIException(responseBody);
+                    }
+                    else
+                    {
+                        throw new APIException($"{response.ResponseMessage.StatusCode}\t{responseBody}");
+                    }
+                }
+                else
+                {
+                    throw response.ResponseException;
+                }
+            }
+            catch (Exception ex)
+            {
+                string message = $"【GetRawItemId】[{url}\n{ex.Message}\n{ex.StackTrace}";
+                NotifyCore.Notify(new NifyMessage
+                {
+                    message = message,
+                    priority = NifyMessagePriority.high,
+                    tags = ["red_circle"]
+                });
+            }
+            return null;
+        }
+
 
         public void GetTkOrders222()
         {

+ 20 - 9
molilian.core/Plus/Alimama/parse_2.cs

@@ -3,6 +3,7 @@ using System.Text.RegularExpressions;
 using System.Diagnostics;
 using System.Text.Json;
 using TencentCloud.Fmu.V20191213.Models;
+using System;
 
 namespace molilian.core
 {
@@ -106,13 +107,14 @@ namespace molilian.core
                 return true;
             }
 
-            if (uri.Host.Equals("m.tb.cn", StringComparison.OrdinalIgnoreCase) &&
-                uri.AbsolutePath.StartsWith("/h.") &&
-                string.IsNullOrEmpty(uri.Query) && // No query parameters
-                !url.Contains("?tk=")) // No "tk" parameter
-            {
-                return true;
-            }
+            //if (uri.Host.Equals("m.tb.cn", StringComparison.OrdinalIgnoreCase) &&
+            //    uri.AbsolutePath.StartsWith("/h.") &&
+            //    string.IsNullOrEmpty(uri.Query) && // No query parameters
+            //    !url.Contains("?tk=")) // No "tk" parameter
+            //{
+            //    return true;
+
+            //}
             return false;
         }
 
@@ -139,6 +141,10 @@ namespace molilian.core
             string result;
             try
             {
+                Uri uri = new(url);
+
+                if (!uri.Host.Equals("m.tb.cn", StringComparison.OrdinalIgnoreCase)) return (false, "不是淘宝短网址");
+
                 string desiredUrlPattern = "var url = '(.*?)'";
                 WebClientUtility client = new()
                 {
@@ -202,6 +208,7 @@ namespace molilian.core
                 //直接提取
                 (success, result) = IsTaobaoUrl(url);
                 if (success) return (true, result, LinkTypeEnum.goods, result);
+                //https://uland.taobao.com/coupon/edetail?af=4&e=%2B0aTAvEt16MoRnbUfHBdCarU9683KT3AsB67n92UtFJMmdsrkidbOWBzzpT26idJbwZX%2BHY%2B8QD9zJXNeOSc1euXSPKeLUBBWr02LqsxPV8Bf6pSMNy5GSw6iqMObXLLk3toOSlQXmUUcLJJYP0Uq5lvDADUDTeHRiuxU0i9W%2BtrC8Oh6piEfdwyUIuKQbeM8rUgQejRG616MoRnbUfHBdCarU9683KT3AsB67n92UtFv6uIFQszbmWWPZ8ka7%2BkV5xXydLt%2FcnuZ4%2BBFYnwwiUaCWC3TckcCwMW8xe3XqOGsb8uv9wbhxdkKJ0hxTrTkj7DNgliTXDluAYBRglsbQ%3D%3D&traceId=212cbaa417178512249145009e05a8&union_lens=lensId%3APUB%401717851219%402103c04a_0c89_18ff7e96612_9d39%40031w5YJSc7jl3U7gYjdvuCMM%40eyJmbG9vcklkIjo4NTAvEt16MoRnbUfHBdCarU9683JDaxNfPy83okP3kLScwCkGiuMcyC4PcynGV0YWlsX2h0bSIsInNyY0Zsb29ySWQiiOiiI4MDY3NCIsImNyZWF0aXZpdHlHcm91cElkIjowfQieie%3BtkScm%3AselectionPlaza_site_4358%3Bscm%3A1007.30148.329090.pub_search-item_c02df4bb-631f-4cc1-a9d5-abe802b8e134_&un=bfc196d23e155d289f2917200ca32a93&share_crt_v=1&un_site=0&ut_sk=1.utdid_null_1717851225204.TaoPassword-Outside.lianmeng-app&spm=a2159r.13376465.0.0&sp_tk=d2hLeFdDNHpKb3Y%3D&cpp=1&shareurl=true&short_name=h.gVx6mvI
 
 
                 //从http获取跳转的url
@@ -209,13 +216,17 @@ namespace molilian.core
                 if (success)
                 {
                     //排除已知的淘客链接
-                    if (IsAffLink(result)) return (false, "排除淘客链接", LinkTypeEnum.other_aff, result);
+                    if (IsAffLink(result)) return (false, "排除淘客链接", LinkTypeEnum.other_aff, url);
 
                     (success, result) = IsTaobaoUrl(result);
                     if (success) return (true, result, LinkTypeEnum.goods, result);
+                    link_type = GetLinkType(result);
                 }
+                else
+                {
+                    link_type = GetLinkType(url);
 
-                link_type = GetLinkType(url);
+                }
                 return (false, result, link_type, url);
             }
 

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff