Jelajahi Sumber

0903 fix bug

dodo hold 2 tahun lalu
induk
melakukan
11a4dbae56

File diff ditekan karena terlalu besar
+ 0 - 0
molilian.api/Properties/PublishProfiles/https___ccr.ccs.tencentyun.com_shaobin.pubxml.user


+ 1 - 0
molilian.core/Core/taoke/UnionCouponCore.cs

@@ -56,6 +56,7 @@ namespace molilian.core
             };
 
             content = AlimamaPlus.FakeItemUrl(content, dplink);
+            result.content = content;
 
             if (string.IsNullOrEmpty(content))
             {

+ 7 - 1
molilian.core/Core/taoke/UnionParseCore.cs

@@ -438,6 +438,7 @@ namespace molilian.core
                     result.success = false;
                     result.message = "放弃转链";
                     result.reason = reason;
+                    result.deeplink_url = JdUnionPlus.GetDeeplink(string.Empty);
                     _ = TkLogCore.ParseLogAsync(result);
                     return JdParseOutput(result);
                 }
@@ -461,6 +462,7 @@ namespace molilian.core
                     result.success = false;
                     result.message = "放弃转链";
                     result.reason = "没有匹配账号";
+                    result.deeplink_url = JdUnionPlus.GetDeeplink(string.Empty);
                     _ = TkLogCore.ParseLogAsync(result);
                     return JdParseOutput(result);
                 }
@@ -497,6 +499,7 @@ namespace molilian.core
                     result.message = "内部错误";
                     result.reason = "转链接口异常";
                 }
+                result.deeplink_url = JdUnionPlus.GetDeeplink(string.Empty);
             }
             _ = TkLogCore.ParseLogAsync(result);
             return JdParseOutput(result, IfExceptional ? APIResultCodeEnum.NotAcceptable : APIResultCodeEnum.OK);
@@ -687,16 +690,17 @@ namespace molilian.core
                     result.success = false;
                     result.message = "放弃转链";
                     result.reason = reason;
+                    result.deeplink_url = KsUnionPlus.GetDeeplink(string.Empty, LinkTypeEnum.baseDomain);
                     _ = TkLogCore.ParseLogAsync(result);
                     return KsParseOutput(result);
                 }
-
                 var account = accountid > 0 ? KsPoolCore.GetOne(accountid, KsPoolCore.KsAction.parse) : KsPoolCore.GetOne(KsPoolCore.KsAction.parse);
                 if (account == null)
                 {
                     result.success = false;
                     result.message = "放弃转链";
                     result.reason = "没有匹配账号";
+                    result.deeplink_url = KsUnionPlus.GetDeeplink(string.Empty, LinkTypeEnum.baseDomain);
                     _ = TkLogCore.ParseLogAsync(result);
                     return KsParseOutput(result);
                 }
@@ -733,6 +737,8 @@ namespace molilian.core
                     result.message = "内部错误";
                     result.reason = "转链接口异常";
                 }
+                result.deeplink_url = KsUnionPlus.GetDeeplink(string.Empty, LinkTypeEnum.baseDomain);
+
             }
             _ = TkLogCore.ParseLogAsync(result);
             return KsParseOutput(result, IfExceptional ? APIResultCodeEnum.NotAcceptable : APIResultCodeEnum.OK);

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

@@ -25,6 +25,7 @@ namespace molilian.core
         public string accountName { get; set; } = string.Empty;
         public string rawContent { get; set; } = string.Empty;
         public string rawContent2 { get; set; } = string.Empty;
+        public string content { get; set; } = string.Empty;
         public bool success { get; set; } = false;
         public string reason { get; set; } = string.Empty;
         public string message { get; set; } = string.Empty;

+ 5 - 4
molilian.core/Plus/Alimama/parse_2.cs

@@ -89,11 +89,12 @@ namespace molilian.core
         /// <returns></returns>
         private static (bool, string) IsTaobaoUrl(string url)
         {
-            if (url.Contains("//a.m.taobao.com/i"))
+            if (url.Contains("//a.m.taobao.com/i") ||
+                url.Contains("//internal.tt.detail.taobao.com/i"))
             {
                 //第一种提取方法
-                string itemId = url.GetContentPart("//a.m.taobao.com/i", ".htm");
-                if (!string.IsNullOrEmpty(itemId))
+                string itemId = url.GetContentPart(".com/i", ".htm");
+                if (!string.IsNullOrEmpty(itemId) && int.TryParse(itemId, out int _))
                 {
                     string resultUrl = $"https://item.taobao.com/item.htm?id={itemId}";
                     return (true, resultUrl);
@@ -109,7 +110,7 @@ namespace molilian.core
                 url.Contains("//tmallx.tmall.com/app/tmallx-src/goods-detail") ||
                 url.Contains("//detail.tmall.com/item.htm?") ||
                 url.Contains("//internal.tt.detail.taobao.com/item.htm?") ||
-                url.Contains("//internal.tt.detail.taobao.com/item.htm?") ||
+                url.Contains("//internal.tt.detail.taobao.com/") ||
                 url.Contains("//detail.tmall.hk/hk/item.htm?"))
             {
                 string? itemId = ExtractItemId(url);

+ 11 - 1
molilian.core/Plus/ks/KsUnionPlus.cs

@@ -32,7 +32,7 @@ namespace molilian.core
         public static string GetDeeplink(string url, LinkTypeEnum type)
         {
             string shareObjectId = string.Empty;
-            string url_pattern = @"shareObjectId=([^\s&]+)";
+            string url_pattern = @"shareObjectId=([^,%&]+)";
             var match = Regex.Match(url, url_pattern);
             if (match.Success) shareObjectId = match.Groups[1].Value;
 
@@ -239,6 +239,16 @@ namespace molilian.core
 
 
 
+            //临时规则
+            if (!content.Contains("商品"))
+            {
+                result.success = false;
+                result.message = "放弃转链";
+                result.reason = "非商品链接";
+                result.deeplink_url = GetDeeplink(content, LinkTypeEnum.goods);
+                return result;
+            }
+
             switch (_account.work_mode)
             {
                 case KsUnionWorkMode.SiteApi:

+ 2 - 2
molilian.core/Plus/ks/open.cs

@@ -79,7 +79,7 @@ namespace molilian.core
         {
             //todo 写死 
             var _ticket = new dodohold.core.kwaixiaodian.AccessTokenDTO();
-            _ticket.access_token = "ChFvYXV0aC5hY2Nlc3NUb2tlbhIwbmKPStYeS1x-ZvbjXU5Di0DQpSKhBSpJr8Zni_S0ltA0di1ryALJD4K_4tF1ovA6GhLiICkHPKJFr7JGeErh7m5jzagiIJ5kqUgNpOvl9uBTg4gE4DiEc84Mu8ssnaAInrHmwbmtKAUwAQ";
+            _ticket.access_token = "ChFvYXV0aC5hY2Nlc3NUb2tlbhIwgR5U9K4VkaH5vh9ze_dvEaspL-4YVYgxLEbucXH_CJJodPtY6kPHuqDbtLK01JFUGhITB63P569DkqhlagGy21IJcH4iIDl5JrMkxS5areOgIXsfiWPjZa1sdiWFhNAXEpDLcfkhKAUwAQ";
 
 
             string action = "open.distribution.cps.kwaimoney.link.parse";
@@ -95,7 +95,7 @@ namespace molilian.core
         {
             //todo 写死 
             var _ticket = new dodohold.core.kwaixiaodian.AccessTokenDTO();
-            _ticket.access_token = "ChFvYXV0aC5hY2Nlc3NUb2tlbhIwbmKPStYeS1x-ZvbjXU5Di0DQpSKhBSpJr8Zni_S0ltA0di1ryALJD4K_4tF1ovA6GhLiICkHPKJFr7JGeErh7m5jzagiIJ5kqUgNpOvl9uBTg4gE4DiEc84Mu8ssnaAInrHmwbmtKAUwAQ";
+            _ticket.access_token = "ChFvYXV0aC5hY2Nlc3NUb2tlbhIwgR5U9K4VkaH5vh9ze_dvEaspL-4YVYgxLEbucXH_CJJodPtY6kPHuqDbtLK01JFUGhITB63P569DkqhlagGy21IJcH4iIDl5JrMkxS5areOgIXsfiWPjZa1sdiWFhNAXEpDLcfkhKAUwAQ";
 
 
             string action = "open.distribution.cps.kwaimoney.link.create";

+ 7 - 1
molilian.core/Plus/pdd/PddUnionPlus.cs

@@ -33,10 +33,16 @@ namespace molilian.core
         {
             string shortLinkurl = GetLink(content);
             string deeplink_url = GetDeeplink(shortLinkurl);
+            var link_type = LinkTypeEnum.unknown;
+            if (!string.IsNullOrEmpty(shortLinkurl) && shortLinkurl.StartsWith("https://p.pinduoduo.com/"))
+            {
+                link_type = LinkTypeEnum.other_aff;
+            }
+
             return new PddDataDTO()
             {
                 message = string.Empty,
-                link_type = LinkTypeEnum.unknown,
+                link_type = link_type,
                 channel = TkChannelEnum.pdd,
                 accountName = string.Empty,
                 success = false,

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini