Kaynağa Gözat

增加账号属性变更;
修复补点击apibug;
增加配置项:补点击有效时间;
补充从转链正文获取标题信息;

dodo hold 2 yıl önce
ebeveyn
işleme
fd8fd6790e

+ 40 - 0
molilian.api/Controllers/admin/TaobaoController.cs

@@ -2,6 +2,7 @@ using molilian.core;
 using dodohold.core;
 using Microsoft.AspNetCore.Mvc;
 using System.Text.Json;
+using System.Net;
 namespace molilian.api.Controllers
 {
     [ApiController]
@@ -29,6 +30,45 @@ namespace molilian.api.Controllers
         }
 
 
+        [HttpPost]
+        public async Task<ActionResult> update([FromBody] JsonElement form)
+        {
+            int id = form.Read<int>("id", 0);
+            string name = form.Read<string>("name", string.Empty);
+            string val = form.Read<string>("val", string.Empty);
+
+            if (id == 0)
+            {
+                return new APIResult(new { data = new { success = false, msg = "更新失败,请检查输入的cookie" } });
+            }
+
+            int result = 0;
+            switch (name)
+            {
+                case "enable_fake_click":
+                case "status":
+                    bool bVal = val.Equals("True");
+                    result = new DBContext.Table("tk_pool")
+                           .Add(name, bVal)
+                           .Add("last_time", DateTime.Now)
+                           .Where("id=@id", new { id })
+                           .Update();
+                    break;
+                default:
+                    return new APIResult(new { data = new { success = false, msg = "更新失败,未授权操作" } });
+            }
+
+            TkPoolCore.Refresh();
+
+            bool success = result > 0;
+
+            return new APIResult(new
+            {
+                data = new { success, msg = success ? "更新成功" : "更新失败,请检查输入信息" },
+            });
+        }
+
+
         /// <summary>
         /// 账号列表
         /// </summary>

+ 1 - 1
molilian.api/Controllers/public/TkController.cs

@@ -582,7 +582,7 @@ namespace molilian.api.Controllers
             List<object> list = [];
             foreach (var item in data)
             {
-                list.Add(new { url = item.deeplinkUrl, count = 4, time = item.exp_time });
+                list.Add(new { url = item.deeplinkUrl, count = item.click_num, time = item.exp_time });
             }
 
             return new APIResult(new

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
molilian.api/Properties/PublishProfiles/https___ccr.ccs.tencentyun.com_shaobin.pubxml.user


+ 3 - 3
molilian.api/Properties/launchSettings.json

@@ -6,7 +6,7 @@
       "launchUrl": "swagger",
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development",
-        "EndPoint": "gz",
+        "EndPoint": "bj",
         "NtfyServer": "https://ntfy.yunhui800.com/5Sq9BytXXM5WDY3G",
         "ANPush": "",
         "DBType": "MySQL",
@@ -14,7 +14,7 @@
         "RedisConfig": "47.95.66.125:6379,password=pKBiS4ka2IpXayIdcx00,defaultDatabase=0,idleTimeout=20000,preheat=3,tryit=2,ssl=false,prefix=webhook"
       },
       "dotnetRunMessages": true,
-      "applicationUrl": "http://localhost:5186"
+      "applicationUrl": "http://localhost:8186"
     },
     "https": {
       "commandName": "Project",
@@ -24,7 +24,7 @@
         "ASPNETCORE_ENVIRONMENT": "Development"
       },
       "dotnetRunMessages": true,
-      "applicationUrl": "https://localhost:7159;http://localhost:5186"
+      "applicationUrl": "https://localhost:7159;http://localhost:8186"
     },
     "IIS Express": {
       "commandName": "IISExpress",

+ 4 - 2
molilian.core/Core/taoke/OrderTrackingCore.cs

@@ -21,11 +21,13 @@ namespace molilian.core
     {
         public static void SaveLinkSummary(TkDataDTO item)
         {
+            var config = TkConfigCore.Get();
+            var ttl = config.fake_click_ttl * 3600;
             string cacheKey = $":cache:order_summary:{item.accountName}:{item.itemId}";
-            RedisHelper.Set(cacheKey, item, 86400);
+            RedisHelper.Set(cacheKey, item, ttl);
 
             cacheKey = $":cache:order_summary:{item.accountName}:{item.itemName}";
-            RedisHelper.Set(cacheKey, item, 86400);
+            RedisHelper.Set(cacheKey, item, ttl);
         }
         public static TkDataDTO GetLinkSummary(string accountName, string name)
         {

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

@@ -60,9 +60,7 @@ 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;

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

@@ -9,5 +9,6 @@
         public string ignorePercentageCity { get; set; } = string.Empty;
         public int fake_click_min { get; set; }
         public int fake_click_max { get; set; }
+        public int fake_click_ttl { get; set; } = 86400;
     }
 }

+ 11 - 0
molilian.core/Plus/Alimama/parse.cs

@@ -65,6 +65,7 @@ namespace molilian.core
                 result.accountName = string.Empty;
                 result.content = content;
                 result.deeplink_url = GetDeeplink(null);
+                result.itemName = GetTitle(content);
                 result.accountName = string.Empty;
             }
             else
@@ -92,6 +93,7 @@ namespace molilian.core
                 result.accountName = string.Empty;
                 result.content = content;
                 result.deeplink_url = GetDeeplink(null);
+                result.itemName = GetTitle(content);
             }
             else
             {
@@ -150,6 +152,15 @@ namespace molilian.core
         }
 
 
+        public static string GetTitle(string content)
+        {
+            content = content.Replace("点击链接直接打开 或者 淘宝搜索直接打开", string.Empty).Trim();
+            string[] words = Regex.Split(content, @"\s+");
+            string word = words[^1];
+            return word;
+        }
+
+
 
 
         static bool IgnoreRegionIncluded(string _ignoreRegions, string? ipInfo, out string regionInfo)

+ 2 - 2
molilian.core/Plus/Alimama/parse_2.cs

@@ -127,7 +127,7 @@ namespace molilian.core
         {
             // 使用正则表达式匹配内容中是否含有特定格式的字符串
             //string pattern = @"¥[a-zA-Z0-9\s]+¥";
-            string pattern = @"[$¥🗝₴€₤£₳✔《💰🔑🎵✔️💲🔐📲]+[a-zA-Z0-9]+[$¥🗝₴€₤£₳✔《💰🔑🎵✔️💲🔐📲]*";
+            string pattern = @"[$¥🗝₴€₤£₳✔《💰🔑🎵✔️💲🔐📲]+[a-zA-Z0-9\s]+[$¥🗝₴€₤£₳✔《💰🔑🎵✔️💲🔐📲]*";
             return Regex.IsMatch(content, pattern);
         }
 
@@ -589,7 +589,7 @@ namespace molilian.core
                 result.deeplink_url = deeplink_url;
 
                 result.itemId = itemId;
-                result.itemName = itemName;
+                result.itemName = success ? itemName : GetTitle(content);
                 result.promotionPrice = promotionPrice;
                 result.sellerNickName = sellerNickName;
                 result.shopTitle = shopTitle;

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor