bug修复

This commit is contained in:
jianzhichu
2025-11-30 21:33:18 +08:00
parent e42a004765
commit 50149a280b
57 changed files with 766 additions and 317 deletions
+28 -1
View File
@@ -2,6 +2,7 @@
using dy.net.dto;
using dy.net.model;
using dy.net.service;
using dy.sync.lib;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -20,12 +21,14 @@ namespace dy.net.Controllers
private readonly DouyinCommonService commonService;
private readonly DouyinQuartzJobService quartzJobService;
private readonly IHttpClientFactory httpClientFactory;
public ConfigController(DouyinCookieService dyCookieService, DouyinCommonService commonService,DouyinQuartzJobService quartzJobService)
public ConfigController(DouyinCookieService dyCookieService, DouyinCommonService commonService,DouyinQuartzJobService quartzJobService,IHttpClientFactory httpClientFactory)
{
this.dyCookieService = dyCookieService;
this.commonService = commonService;
this.quartzJobService = quartzJobService;
this.httpClientFactory = httpClientFactory;
}
@@ -163,5 +166,29 @@ namespace dy.net.Controllers
quartzJobService.InitOrReStartAllJobs(config.Cron.ToString());
//避免前端等待
}
/// <summary>
/// 镜像标签
/// </summary>
/// <returns></returns>
[HttpGet("mytag")]
public async Task<IActionResult> GetMyTag()
{
return Ok(new { code = 0, data =Appsettings.Get("tagName") });
}
[HttpGet("checktag")]
public async Task<IActionResult> CheckTag()
{
var data =await DouyinHttpHelper.GetTenImage(Appsettings.Get("tagName"));
if (data.IsSuccessStatusCode)
{
var content = await data.Content.ReadAsStringAsync();
return Ok(content);
}
else
{
return BadRequest(new { code = -1, message = "请求失败" });
}
}
}
}
@@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<_PublishTargetUrl>E:\code\dysync\bin\Release\net6.0\publish\</_PublishTargetUrl>
<History>True|2025-11-29T18:06:06.6099669Z||;True|2025-11-30T01:49:46.4358206+08:00||;False|2025-11-30T01:49:34.4884036+08:00||;True|2025-11-30T01:43:41.1028753+08:00||;True|2025-11-30T01:38:18.2856609+08:00||;True|2025-11-30T01:23:02.4378259+08:00||;True|2025-11-30T01:08:29.4041159+08:00||;True|2025-11-30T00:56:33.4172007+08:00||;False|2025-11-30T00:56:21.2777389+08:00||;True|2025-11-27T13:37:08.6884390+08:00||;False|2025-11-27T13:36:54.2595622+08:00||;True|2025-11-27T11:03:33.8401644+08:00||;False|2025-11-27T11:02:48.8942827+08:00||;True|2025-11-26T23:48:02.3957186+08:00||;True|2025-11-26T23:43:06.8154188+08:00||;False|2025-11-26T23:42:05.9191485+08:00||;True|2025-11-26T23:30:11.1295861+08:00||;True|2025-11-26T00:00:42.1507258+08:00||;True|2025-11-26T00:00:17.0107229+08:00||;True|2025-11-25T23:42:07.4349629+08:00||;False|2025-11-25T23:41:56.9328658+08:00||;True|2025-11-25T23:19:32.5262917+08:00||;True|2025-11-25T14:08:53.3850967+08:00||;True|2025-11-24T23:53:54.4283003+08:00||;True|2025-11-24T23:41:15.8248332+08:00||;True|2025-11-24T23:33:57.1844427+08:00||;True|2025-11-24T23:31:54.9228836+08:00||;True|2025-11-24T23:24:15.8681502+08:00||;True|2025-11-24T23:22:57.9046229+08:00||;True|2025-11-24T23:18:04.1131647+08:00||;True|2025-11-24T22:47:54.1336448+08:00||;True|2025-11-24T22:47:18.3613833+08:00||;True|2025-11-24T08:17:50.3994607+08:00||;True|2025-11-24T08:07:00.9951205+08:00||;True|2025-11-23T23:34:50.0030826+08:00||;True|2025-11-23T23:32:36.7452616+08:00||;True|2025-11-22T23:18:56.3202345+08:00||;True|2025-11-22T22:52:51.7203302+08:00||;True|2025-11-22T22:52:42.9620946+08:00||;True|2025-11-22T22:52:09.8257640+08:00||;True|2025-11-22T22:39:31.5894141+08:00||;True|2025-11-22T22:31:11.0704815+08:00||;True|2025-11-22T22:20:36.4579131+08:00||;True|2025-11-22T22:19:10.2281364+08:00||;True|2025-11-22T19:34:45.9336901+08:00||;True|2025-11-12T23:06:38.7834109+08:00||;False|2025-11-12T23:01:02.2269478+08:00||;True|2025-10-22T22:08:11.6423148+08:00||;True|2025-10-22T21:54:24.7180547+08:00||;True|2025-10-22T21:40:03.5194315+08:00||;True|2025-10-22T21:28:28.8962766+08:00||;True|2025-10-22T21:22:47.9631689+08:00||;True|2025-10-22T21:18:24.5274318+08:00||;True|2025-10-22T21:14:51.6386326+08:00||;False|2025-10-22T21:14:07.6282769+08:00||;True|2025-10-22T21:03:48.9892860+08:00||;True|2025-10-22T21:00:56.3617243+08:00||;False|2025-10-22T21:00:30.5472941+08:00||;True|2025-10-22T20:51:29.6155916+08:00||;False|2025-10-22T20:50:47.1882956+08:00||;True|2025-10-22T15:01:04.1668366+08:00||;True|2025-10-22T14:49:43.6340569+08:00||;True|2025-10-22T14:38:39.4685603+08:00||;True|2025-10-21T18:35:28.8392541+08:00||;True|2025-10-20T10:31:05.5865212+08:00||;True|2025-10-20T10:20:41.5717101+08:00||;True|2025-10-19T10:08:33.6669332+08:00||;False|2025-10-19T10:07:22.3337545+08:00||;False|2025-10-19T10:05:22.9484805+08:00||;True|2025-10-10T16:54:27.1472888+08:00||;False|2025-10-10T16:53:44.1700030+08:00||;False|2025-10-10T16:52:48.1740453+08:00||;False|2025-10-10T16:51:21.5067253+08:00||;False|2025-10-10T16:50:19.2140597+08:00||;False|2025-10-10T16:49:21.2213290+08:00||;False|2025-10-10T16:48:47.7229948+08:00||;False|2025-10-10T16:48:15.1258700+08:00||;True|2025-09-30T13:29:42.2354235+08:00||;True|2025-09-25T11:44:52.6858389+08:00||;True|2025-09-25T11:08:27.8810109+08:00||;True|2025-09-25T09:28:50.2563374+08:00||;True|2025-09-24T16:14:02.3072184+08:00||;True|2025-09-23T22:38:52.4414757+08:00||;True|2025-09-23T22:19:07.1006356+08:00||;True|2025-09-23T22:18:01.5945225+08:00||;True|2025-09-23T22:06:15.6293613+08:00||;True|2025-09-23T21:53:14.2977444+08:00||;True|2025-09-23T21:46:55.2322411+08:00||;False|2025-09-23T21:45:23.7858854+08:00||;False|2025-09-23T21:03:51.8325689+08:00||;True|2025-09-23T10:03:32.2251920+08:00||;False|2025-09-23T09:38:08.2372201+08:00||;False|2025-09-23T09:37:49.9390545+08:00||;True|2024-03-11T21:31:45.8102398+08:00||;True|2024-03-11T07:26:24.7660541+08:00||;True|2024-03-08T22:08:40.0154831+08:00||;True|2024-03-03T10:14:36.8109114+08:00||;True|2024-03-02T18:44:57.3288537+08:00||;True|2024-01-24T17:51:37.9164415+08:00||;True|2024-01-24T16:36:50.5612157+08:00||;</History>
<History>True|2025-11-30T13:16:56.7088027Z||;False|2025-11-30T21:16:46.1444944+08:00||;True|2025-11-30T20:21:24.4059664+08:00||;False|2025-11-30T20:21:17.6006098+08:00||;True|2025-11-30T20:20:08.2030141+08:00||;False|2025-11-30T20:16:12.3608968+08:00||;True|2025-11-30T20:15:35.6048313+08:00||;True|2025-11-30T19:45:18.7229552+08:00||;True|2025-11-30T19:45:08.6083368+08:00||;False|2025-11-30T19:44:54.7824905+08:00||;True|2025-11-30T19:44:17.0179491+08:00||;True|2025-11-30T19:44:06.7073484+08:00||;False|2025-11-30T19:43:58.2896556+08:00||;True|2025-11-30T19:42:08.2261927+08:00||;True|2025-11-30T19:28:15.7115077+08:00||;False|2025-11-30T19:28:10.2280725+08:00||;True|2025-11-30T19:23:31.7859158+08:00||;True|2025-11-30T19:23:20.7788277+08:00||;True|2025-11-30T19:17:11.8583296+08:00||;False|2025-11-30T19:10:41.8369574+08:00||;True|2025-11-30T19:02:08.8184758+08:00||;False|2025-11-30T19:01:59.4711045+08:00||;True|2025-11-30T18:16:01.8372242+08:00||;True|2025-11-30T14:50:31.9356543+08:00||;True|2025-11-30T14:48:27.1833064+08:00||;True|2025-11-30T02:06:06.6099669+08:00||;True|2025-11-30T01:49:46.4358206+08:00||;False|2025-11-30T01:49:34.4884036+08:00||;True|2025-11-30T01:43:41.1028753+08:00||;True|2025-11-30T01:38:18.2856609+08:00||;True|2025-11-30T01:23:02.4378259+08:00||;True|2025-11-30T01:08:29.4041159+08:00||;True|2025-11-30T00:56:33.4172007+08:00||;False|2025-11-30T00:56:21.2777389+08:00||;True|2025-11-27T13:37:08.6884390+08:00||;False|2025-11-27T13:36:54.2595622+08:00||;True|2025-11-27T11:03:33.8401644+08:00||;False|2025-11-27T11:02:48.8942827+08:00||;True|2025-11-26T23:48:02.3957186+08:00||;True|2025-11-26T23:43:06.8154188+08:00||;False|2025-11-26T23:42:05.9191485+08:00||;True|2025-11-26T23:30:11.1295861+08:00||;True|2025-11-26T00:00:42.1507258+08:00||;True|2025-11-26T00:00:17.0107229+08:00||;True|2025-11-25T23:42:07.4349629+08:00||;False|2025-11-25T23:41:56.9328658+08:00||;True|2025-11-25T23:19:32.5262917+08:00||;True|2025-11-25T14:08:53.3850967+08:00||;True|2025-11-24T23:53:54.4283003+08:00||;True|2025-11-24T23:41:15.8248332+08:00||;True|2025-11-24T23:33:57.1844427+08:00||;True|2025-11-24T23:31:54.9228836+08:00||;True|2025-11-24T23:24:15.8681502+08:00||;True|2025-11-24T23:22:57.9046229+08:00||;True|2025-11-24T23:18:04.1131647+08:00||;True|2025-11-24T22:47:54.1336448+08:00||;True|2025-11-24T22:47:18.3613833+08:00||;True|2025-11-24T08:17:50.3994607+08:00||;True|2025-11-24T08:07:00.9951205+08:00||;True|2025-11-23T23:34:50.0030826+08:00||;True|2025-11-23T23:32:36.7452616+08:00||;True|2025-11-22T23:18:56.3202345+08:00||;True|2025-11-22T22:52:51.7203302+08:00||;True|2025-11-22T22:52:42.9620946+08:00||;True|2025-11-22T22:52:09.8257640+08:00||;True|2025-11-22T22:39:31.5894141+08:00||;True|2025-11-22T22:31:11.0704815+08:00||;True|2025-11-22T22:20:36.4579131+08:00||;True|2025-11-22T22:19:10.2281364+08:00||;True|2025-11-22T19:34:45.9336901+08:00||;True|2025-11-12T23:06:38.7834109+08:00||;False|2025-11-12T23:01:02.2269478+08:00||;True|2025-10-22T22:08:11.6423148+08:00||;True|2025-10-22T21:54:24.7180547+08:00||;True|2025-10-22T21:40:03.5194315+08:00||;True|2025-10-22T21:28:28.8962766+08:00||;True|2025-10-22T21:22:47.9631689+08:00||;True|2025-10-22T21:18:24.5274318+08:00||;True|2025-10-22T21:14:51.6386326+08:00||;False|2025-10-22T21:14:07.6282769+08:00||;True|2025-10-22T21:03:48.9892860+08:00||;True|2025-10-22T21:00:56.3617243+08:00||;False|2025-10-22T21:00:30.5472941+08:00||;True|2025-10-22T20:51:29.6155916+08:00||;False|2025-10-22T20:50:47.1882956+08:00||;True|2025-10-22T15:01:04.1668366+08:00||;True|2025-10-22T14:49:43.6340569+08:00||;True|2025-10-22T14:38:39.4685603+08:00||;True|2025-10-21T18:35:28.8392541+08:00||;True|2025-10-20T10:31:05.5865212+08:00||;True|2025-10-20T10:20:41.5717101+08:00||;True|2025-10-19T10:08:33.6669332+08:00||;False|2025-10-19T10:07:22.3337545+08:00||;False|2025-10-19T10:05:22.9484805+08:00||;True|2025-10-10T16:54:27.1472888+08:00||;False|2025-10-10T16:53:44.1700030+08:00||;False|2025-10-10T16:52:48.1740453+08:00||;False|2025-10-10T16:51:21.5067253+08:00||;False|2025-10-10T16:50:19.2140597+08:00||;False|2025-10-10T16:49:21.2213290+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
<ItemGroup>
+12 -8
View File
@@ -91,12 +91,13 @@ Cookie 及 `sec_user_id` 是同步功能的核心,需严格按步骤获取,
| 镜像标签 | 架构 | 功能描述 |
| ----------------- | -------------- | --------------------------------------------------------------------- |
| `latest` | x86_64 (amd64) | **标准版**- 包含核心功能- **不含 FFmpeg**- 不能下载图文视频 |
| `full_latest` | x86_64 (amd64) | **完整版**- 包含全部核心功能- **内置 FFmpeg**- 支持图文视频下载与合成 |
| `arm_latest` | ARM64 | **ARM 标准**- 核心功能(与 `latest` 一致) |
| `full_arm_latest` | ARM64 | **ARM 完整版**- 完整功能(与 `full_latest` 一致) |
| `beta_1.2` | x86_64 (amd64) | **测试版 v1.0**- 测试版 |
| `mini_1.5.7` | x86_64 (amd64) | **精简版**- 不能下载图文视频 |
| `beta_1.5.7` | x86_64 (amd64) | **完整版**- 支持图文视频下载与合成 |
| `armmin_1.5.7` | ARM64 | **ARM 精简**- 不能下载图文视频 |
| `arm_1.5.7` | ARM64 | **ARM 完整版**- 支持图文视频下载与合成 |
### 最新镜像查看
[镜像列表](http://nas.synology2023.online:10108/api/docker/dysync/1)
### 构建命令示例
将下方命令中的「本地路径」替换为你的实际路径,终端执行即可:
@@ -111,7 +112,7 @@ docker run -d --restart=always \
-v /opt/dysync/uper:/app/uper \
-p 10103:10101 \
--name dysync2025 \
registry.cn-hangzhou.aliyuncs.com/jianzhichu/dysync.net:latest
ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_1.5.7
# 注意:-p 后面的容器端口,可以用环境变量类似:ASPNETCORE_URLS = http://+:10108 指定
```
@@ -125,7 +126,7 @@ version: '3.8'
services:
dysync:
image: registry.cn-hangzhou.aliyuncs.com/jianzhichu/dysync.net:latest
image: ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_1.5.7
container_name: dysync2025 # 容器名称
restart: unless-stopped # 始终重启容器,除非容器被手动停止或Docker服务停止
ports:
@@ -168,7 +169,7 @@ services:
![输入图片说明](docs/player.png)
![输入图片说明](docs/follows.png)
## 🚀 5. 已有功能与计划
@@ -196,3 +197,6 @@ services:
11. ✅ 选中记录,批量重新同步。以及分享(比较简陋)
12. ⭕️ <span style="color: #999;">关注列表支持新增,非关注的博主</span>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<movie>
<title>打工人必备3个邪修办公工具,早用早下班!!#办公技巧 #干货分享 #文员 #找工作 #vlog日常</title>
<author>丸子不是圆子</author>
<releasedate>2025-11-14</releasedate>
<genre>个人管理</genre>
<genre>职场技能</genre>
<genre>办公效率</genre>
<actors>
<actor>
<name>丸子不是圆子</name>
<role>主演</role>
<thumb>app/coll2\author\3833318009221843.jpg</thumb>
</actor>
</actors>
<thumb aspect="poster">poster.jpg</thumb>
<fanart>
<thumb>poster.jpg</thumb>
</fanart>
</movie>
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<movie>
<title>冬天穿羽绒服就扎这三款丸子头 #简单盘发教程 #扎发教程 #简单好看发型 #日常编发 #盘发</title>
<author>爱编发的小童</author>
<releasedate>2025-11-19</releasedate>
<genre>时尚</genre>
<genre>彩妆</genre>
<genre>发型</genre>
<actors>
<actor>
<name>爱编发的小童</name>
<role>主演</role>
<thumb>app/coll2\author\2253324655537024.jpg</thumb>
</actor>
</actors>
<thumb aspect="poster">poster.jpg</thumb>
<fanart>
<thumb>poster.jpg</thumb>
</fanart>
</movie>
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<movie>
<title>“最好的医生”其实就在你身边,医生眼里的“最好”:白开水、阳光、徒步……</title>
<author>新华社</author>
<releasedate>2025-11-07</releasedate>
<genre>时政社会</genre>
<genre>社会新闻</genre>
<genre>民生</genre>
<actors>
<actor>
<name>新华社</name>
<role>主演</role>
<thumb>app/coll2\author\93288642596.jpg</thumb>
</actor>
</actors>
<thumb aspect="poster">poster.jpg</thumb>
<fanart>
<thumb>poster.jpg</thumb>
</fanart>
</movie>
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<movie>
<title>披星戴月的日子值吗?男孩分享爸爸送给自己的一段话,自律的苦轻如鸿毛,后悔的痛重过千斤。</title>
<author>新华社</author>
<releasedate>2025-11-22</releasedate>
<genre>时政社会</genre>
<genre>社会新闻</genre>
<genre>民生</genre>
<actors>
<actor>
<name>新华社</name>
<role>主演</role>
<thumb>app/coll2\author\93288642596.jpg</thumb>
</actor>
</actors>
<thumb aspect="poster">poster.jpg</thumb>
<fanart>
<thumb>poster.jpg</thumb>
</fanart>
</movie>
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<movie>
<title>每天练一题,让孩子爱上数学!小学数学奥数竖式谜口诀解题技巧 #小学数学 #小学奥数 #小学数学解题技巧 #小学数学思维 #小学数学题讲解视频</title>
<author>懒熊数学思维(小学奥数)</author>
<releasedate>2025-11-25</releasedate>
<genre>校园教育</genre>
<genre>K12教育</genre>
<genre>学科教育</genre>
<actors>
<actor>
<name>懒熊数学思维(小学奥数)</name>
<role>主演</role>
<thumb>app/coll2\author\3432007521806423.jpg</thumb>
</actor>
</actors>
<thumb aspect="poster">poster.jpg</thumb>
<fanart>
<thumb>poster.jpg</thumb>
</fanart>
</movie>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<movie>
<title>万万没想到,文件传输助手竟如此全能 #文件传输助手 #冷知识</title>
<author>主持人阿喆</author>
<releasedate>2025-08-01</releasedate>
<genre>科普</genre>
<genre>冷知识</genre>
<actors>
<actor>
<name>主持人阿喆</name>
<role>主演</role>
<thumb>app/fav2\author\75856936333.jpg</thumb>
</actor>
</actors>
<thumb aspect="poster">poster.jpg</thumb>
<fanart>
<thumb>poster.jpg</thumb>
</fanart>
</movie>
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<movie>
<title>幸福的愿望 想念变成空气在叹息</title>
<author>小思宇</author>
<releasedate>2025-06-19</releasedate>
<genre>随拍</genre>
<genre>人物随拍</genre>
<genre>人物图片轮播</genre>
<actors>
<actor>
<name>小思宇</name>
<role>主演</role>
<thumb>app/fav2\author\2664814926116075.jpg</thumb>
</actor>
</actors>
<thumb aspect="poster">poster.jpg</thumb>
<fanart>
<thumb>poster.jpg</thumb>
</fanart>
</movie>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<movie>
<title>放假领她去帮我哥打包,体验生活的不容易。#生产车间现场 #拼命努力的挣钱 #工作实拍</title>
<author>郭小胖</author>
<releasedate>2024-07-20</releasedate>
<genre>随拍</genre>
<genre>生活记录</genre>
<genre>日常vlog</genre>
<actors>
<actor>
<name>郭小胖</name>
<role>主演</role>
<thumb>app/fav2\author\66899755406.jpg</thumb>
</actor>
</actors>
<thumb aspect="poster">poster.jpg</thumb>
<fanart>
<thumb>poster.jpg</thumb>
</fanart>
</movie>
+1 -2
View File
@@ -16,8 +16,6 @@
</stepin-view>
</ThemeProvider>
<my-personal ref="personalRef" />
<!-- <email-set ref="emailRef" /> -->
<!-- <login-modal :unless="['/login']" /> -->
</template>
<script lang="ts" setup>
@@ -36,6 +34,7 @@ const { logout } = useAccountStore();
const showPersonalDrawer = ref<boolean>(false);
const personalRef = ref(null);
const emailRef = ref(null);
const open = ref(true);
const showSetting = ref(false);
const router = useRouter();
+285 -64
View File
@@ -1,86 +1,265 @@
<script lang="ts" setup>
import { reactive } from 'vue';
import { ref, h, VNode, onMounted } from 'vue';
import { StepinHeaderAction } from 'stepin';
// import Notice from '@/components/notice/Notice.vue';
import DayNightSwitch from '@/components/switch/DayNightSwitch.vue';
import { BellOutlined } from '@ant-design/icons-vue';
import { TagsOutlined, CopyOutlined } from '@ant-design/icons-vue'; // 移除不需要的图标
import Fullscreen from '../fullscreen/Fullscreen.vue';
import { useApiStore } from '@/store';
import { notification, message } from 'ant-design-vue';
defineEmits<{
(e: 'showSetting'): void;
}>();
// 版本数据和当前版本状态
const dyVersions = ref<string[]>([]);
const copyLoading = ref<Record<string, boolean>>({}); // 复制按钮加载状态
const notificationKey = ref<string>('version-notification');
const noticeList = reactive([
// 复制版本号方法(优化:去除“(当前版本)”标记,只复制纯版本号)
const copyVersion = (version: string) => {
const pureVersion = version.replace('(当前版本)', '').trim(); // 过滤标记
copyLoading.value[version] = true;
navigator.clipboard
.writeText(pureVersion)
.then(() => {
message.success(`已复制版本: ${pureVersion}`);
})
.catch(() => {
message.error('复制失败,请手动复制');
})
.finally(() => {
copyLoading.value[version] = false;
});
};
// 定义版本列表组件(移除所有额外当前版本标记)
const renderVersionList = (): VNode => {
return h(
'div',
{
title: '消息',
list: [
class: 'custom-version-list',
style: {
width: '100%',
padding: '10px 0',
boxSizing: 'border-box',
display: 'block',
},
},
[
dyVersions.value.length > 0
? dyVersions.value.map((tag, index) => {
const isFirstWithCurrent = tag.includes('(当前版本)'); // 只通过文本判断是否为当前版本
return h(
'div',
{
title: '影佑',
content: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
img: 'src/assets/avatar/face-1.jpg',
time: 0,
class: ['custom-version-item', isFirstWithCurrent ? 'custom-current-version' : ''],
key: index,
title: isFirstWithCurrent ? '当前使用版本 - 点击右侧按钮复制版本号' : '点击右侧按钮复制版本号',
style: {
width: '100%',
padding: '8px 12px',
borderBottom: '1px solid #f0f0f0',
borderRadius: '4px',
transition: 'all 0.2s',
boxSizing: 'border-box',
// 核心:块级Flex,强制内部(文字+按钮)一行
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
whiteSpace: 'nowrap',
// 只保留轻微背景色(可选,可删除)
backgroundColor: isFirstWithCurrent ? 'rgba(24, 144, 255, 0.05)' : 'transparent',
},
],
},
]);
[
// 文本容器(单行+溢出省略)
h(
'div',
{
style: {
display: 'flex',
alignItems: 'center',
// 给按钮留固定空间,文本超长时省略
maxWidth: 'calc(100% - 40px)',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
},
},
[
h(
'span',
{
style: {
fontSize: '14px',
color: isFirstWithCurrent ? '#1890ff' : '#1f2937', // 当前版本文字变色(可选,可删除)
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
},
},
tag // 直接显示带“(当前版本)”的文本
),
]
),
// 复制按钮(固定大小,不挤压)
h(
'button',
{
style: {
width: '24px',
height: '24px',
border: 'none',
borderRadius: '4px',
backgroundColor: 'transparent',
color: copyLoading.value[tag] ? '#d1d5db' : isFirstWithCurrent ? '#1890ff' : '#9ca3af',
cursor: copyLoading.value[tag] ? 'not-allowed' : 'pointer',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
padding: '0',
margin: '0',
flexShrink: '0',
transition: 'all 0.2s',
},
onClick: (e: Event) => {
e.stopPropagation();
copyVersion(tag);
},
disabled: copyLoading.value[tag],
title: copyLoading.value[tag] ? '复制中...' : '复制版本号',
},
[
h(CopyOutlined, {
style: {
fontSize: '14px',
animation: copyLoading.value[tag] ? 'custom-spin 1s linear infinite' : 'none',
},
}),
]
),
]
);
})
: h(
'div',
{
style: {
textAlign: 'center',
color: '#999',
padding: '20px 0',
fontSize: '14px',
backgroundColor: '#f9fafb',
borderRadius: '8px',
margin: '0 12px',
},
},
'暂无版本数据'
),
]
);
};
// 获取版本列表并显示Notification(核心修改这里)
const showVersionNotification = () => {
useApiStore()
.CheckTag()
.then((res) => {
if (res.code === 1) {
dyVersions.value = res.data;
const versionLen = dyVersions.value.length;
if (versionLen > 0) {
const newVersions = [...dyVersions.value]; // 深拷贝避免修改原数据
if (versionLen === 1) {
// 只有1个版本:标记为“最新版”
newVersions[0] = `${newVersions[0]}(最新版)`;
} else {
// 大于1个版本:第一个加“当前版本”,最后一个加“最新版”
newVersions[0] = `${newVersions[0]}(当前版本)`;
const lastIndex = versionLen - 1;
newVersions[lastIndex] = `${newVersions[lastIndex]}(最新版)`;
}
dyVersions.value = newVersions;
}
openVersionNotification();
} else {
message.error(res.msg);
}
})
.catch((err) => {
message.error('获取版本列表失败');
console.error(err);
});
};
// 打开版本通知
const openVersionNotification = () => {
notification.open({
key: notificationKey.value,
message: '', // 空消息标题
duration: 5, // 5秒自动关闭(可改为0不自动关闭)
placement: 'topRight',
description: renderVersionList(),
style: {
width: '520px',
minWidth: '520px',
marginTop: '50px',
height: 'auto',
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.08)',
borderRadius: '8px',
boxSizing: 'border-box',
},
});
// 强制覆盖AntD默认换行样式
setTimeout(() => {
const notificationEl = document.querySelector('.custom-version-notification');
if (notificationEl) {
const descriptionEls = notificationEl.querySelectorAll('.ant-notification-notice-description');
descriptionEls.forEach((el) => {
const htmlEl = el as HTMLElement;
htmlEl.style.whiteSpace = 'normal';
htmlEl.style.width = '100%';
htmlEl.style.height = 'auto';
htmlEl.style.overflow = 'visible';
});
}
}, 0);
};
// 全局注入加载动画样式
onMounted(() => {
if (!document.querySelector('#custom-spin-style')) {
const style = document.createElement('style');
style.id = 'custom-spin-style';
style.textContent = `
@keyframes custom-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
`;
document.head.appendChild(style);
}
});
</script>
<template>
<!-- <StepinHeaderAction>
<a-input placeholder="开始搜索...">
<template #prefix>
<search-outlined />
</template>
</a-input>
</StepinHeaderAction> -->
<StepinHeaderAction>
<DayNightSwitch />
</StepinHeaderAction>
<!-- <StepinHeaderAction> -->
<!-- <a-tooltip> -->
<!-- placement="rightTop" -->
<!-- <template #title><span style="color:yellow">Swagger Api</span></template> -->
<!-- <a class="action-item" href="/swagger" target="_blank"> -->
<!-- <ApiOutlined /> -->
<!-- <img class="gitee-logo" alt="swagger api" src="@/assets/swagger.png" /> -->
<!-- </a> -->
<!-- </a-tooltip> -->
<!-- </StepinHeaderAction> -->
<!-- <StepinHeaderAction>
<a class="action-item" href="https://github.com/jianzhichu/dysync.net" target="_blank">
<GithubOutlined />
</a>
</StepinHeaderAction>
<!-- 版本按钮 -->
<StepinHeaderAction>
<a class="action-item" href="https://gitee.com/deathvicky/dysync.net" target="_blank">
<img class="gitee-logo" src="@/assets/gitee.svg" />
</a>
</StepinHeaderAction> -->
<!-- <a-popover placement="bottomRight">
<StepinHeaderAction>
<div class="action-item notice">
<BellOutlined />
<div @click="showVersionNotification" class="action-item">
<TagsOutlined class="action-icon" />
</div>
</StepinHeaderAction>
<template #content>
<Notice :data-source="noticeList" />
</template>
</a-popover> -->
<StepinHeaderAction>
<Fullscreen class="-mx-xs -my-sm h-[56px] px-xs py-sm flex items-center" target=".stepin-layout" />
</StepinHeaderAction>
<!-- <StepinHeaderAction>
@click="$emit('showSetting')"
<div class="action-item setting">
<SettingOutlined />
</div>
</StepinHeaderAction> -->
</template>
<style scoped lang="less">
.gitee-logo {
width: 20px;
}
/* 顶部按钮样式 */
.action-item {
font-size: 20px;
height: 100%;
@@ -89,13 +268,55 @@ const noticeList = reactive([
line-height: 40px;
display: flex;
align-items: center;
cursor: pointer;
&.setting {
font-size: 18px;
&:hover {
color: #1890ff;
}
}
.action-icon {
font-size: 20px;
}
/* 样式兜底:确保每个版本项内部单行,外部纵向排列 */
:deep(.custom-version-notification) {
.ant-notification-notice-description {
white-space: normal !important; /* 允许版本项纵向换行 */
width: 100% !important;
height: auto !important;
overflow: visible !important;
}
&.notice {
font-size: 18px;
.custom-version-item {
display: flex !important;
align-items: center !important;
justify-content: space-between !important;
white-space: nowrap !important; /* 禁止版本项内部换行 */
padding: 8px 12px !important; /* 重置内边距,去掉左侧竖线空间 */
&:hover {
background-color: #f5fafe !important;
}
&:last-child {
border-bottom: none !important;
}
}
/* 当前版本轻微高亮(可选,可删除) */
.custom-current-version {
background-color: rgba(24, 144, 255, 0.05) !important;
&:hover {
background-color: rgba(24, 144, 255, 0.1) !important;
}
}
/* 按钮hover样式 */
button:hover {
background-color: rgba(24, 144, 255, 0.1) !important;
color: #1890ff !important;
}
}
</style>
+188
View File
@@ -0,0 +1,188 @@
<!-- components/VersionDrawer.vue -->
<script lang="ts" setup>
import { ref, watch, onMounted } from 'vue';
import { Drawer } from 'ant-design-vue';
import { CloseOutlined, CopyOutlined, CheckCircleOutlined } from '@ant-design/icons-vue';
import { useApiStore } from '@/store';
import { message } from 'ant-design-vue';
// ✅ 移除 defineProps/defineEmits 导入,直接使用
const props = defineProps<{
visible: boolean;
currentVersion?: string; // 接收当前版本号
}>();
const emit = defineEmits<{
(e: 'close'): void;
}>();
// 组件挂载时获取配置
onMounted(() => {});
const getVersions = () => {
useApiStore()
.CheckTag()
.then((res) => {
if (res.code == 1) {
dyVersions.value = res.data;
} else {
message.error(res.msg);
}
});
};
// 版本数据
const dyVersions = ref<string[]>([]);
// 关闭抽屉
const handleClose = () => {
emit('close');
};
// 复制版本号
const copyVersion = (version: string) => {
navigator.clipboard
.writeText(version)
.then(() => {
message.success(`已复制版本: ${version}`);
})
.catch(() => {
message.error('复制失败,请手动复制');
});
};
// 调试:监听 visible 变化,确认父组件传递的状态是否正确
console.log('抽屉初始状态:', props.visible);
watch(
() => props.visible,
(val) => {
console.log('抽屉 visible 变化:', val);
if (val) {
getVersions();
}
}
);
</script>
<template>
<!-- 强制添加样式确保不被隐藏 -->
<a-drawer title="版本列表" placement="right" :visible="props.visible" @close="handleClose" :width="450" :mask="true" :mask-closable="true" :z-index="9999" class="version-drawer">
<div class="version-list">
<div v-for="(tag, index) in dyVersions" :key="index" class="version-item">
<div class="version-info">
{{ tag }}
<!-- 当前版本标记 -->
<span v-if="props.currentVersion === tag" class="current-version-tag">
<CheckCircleOutlined class="current-icon" />
当前版本
</span>
</div>
<!-- 复制按钮 -->
<a-tooltip title="复制版本号" placement="top">
<div class="copy-btn" @click.stop="copyVersion(tag)">
<CopyOutlined />
</div>
</a-tooltip>
</div>
<div v-if="dyVersions.length === 0" class="empty-tip">暂无版本数据</div>
</div>
<!-- <div class="close-btn" @click="handleClose">
<CloseOutlined /> 关闭版本列表
</div> -->
</a-drawer>
</template>
<style scoped lang="less">
/* 强制显示抽屉容器,避免被全局样式隐藏 */
.version-drawer {
display: block !important;
}
:deep(.ant-drawer-content-wrapper) {
display: block !important;
visibility: visible !important;
opacity: 1 !important;
z-index: 9999 !important; /* 确保层级最高 */
}
.version-list {
padding: 20px;
line-height: 2;
}
.version-item {
padding: 10px 0;
border-bottom: 1px solid #f0f0f0;
cursor: pointer;
transition: background 0.2s;
display: flex;
justify-content: space-between;
align-items: center;
&:hover {
background: #f5f5f5;
}
}
.version-info {
display: flex;
align-items: center;
gap: 8px;
}
/* 当前版本标记样式 */
.current-version-tag {
display: flex;
align-items: center;
gap: 4px;
font-size: 12px;
color: #1890ff;
background: #e6f7ff;
padding: 2px 8px;
border-radius: 12px;
}
.current-icon {
font-size: 12px;
}
/* 复制按钮样式 */
.copy-btn {
color: #999;
font-size: 16px;
cursor: pointer;
transition: color 0.2s;
padding: 4px;
border-radius: 4px;
&:hover {
color: #1890ff;
background: #f0f9ff;
}
}
.empty-tip {
text-align: center;
color: #999;
padding: 40px 0;
}
.close-btn {
position: absolute;
bottom: 24px;
left: 50%;
transform: translateX(-50%);
color: #1890ff;
cursor: pointer;
display: flex;
align-items: center;
gap: 6px;
font-size: 14px;
}
/* 调整tooltip样式,避免被遮挡 */
:deep(.ant-tooltip) {
z-index: 10000 !important;
}
</style>
+6 -37
View File
@@ -19,10 +19,10 @@
</div>
</transition>
<!-- 同步按钮请求期间禁用 -->
<!-- <a-button type="primary" class="sync-btn" @click="handleSyncAll" :disabled="isSyncDisabled">
<a-button type="primary" class="sync-btn" @click="handleSyncAll" :disabled="isSyncDisabled">
<SyncOutlined />
<span class="sync-btn-text">同步</span>
</a-button> -->
<span class="sync-btn-text">立即同步</span>
</a-button>
</div>
</div>
<!-- 卡片列表区域 -->
@@ -67,7 +67,7 @@
</template>
<template v-else>
<span class="path-text" :class="{ 'path-empty': !item.savePath }">
{{ item.savePath || '未设置存储文件夹名称' }}
{{ item.savePath || '默认用作者名字' }}
</span>
<!-- 编辑按钮禁用item.isSaving true -->
<a-button type="text" class="edit-btn" @click="() => handleEditPath(item)" title="编辑文件夹名称" :disabled="item.isSaving">
@@ -95,7 +95,7 @@
<div v-if="noMoreData && followData.length > 0" class="no-more-container">暂无更多数据</div>
<!-- 空状态 -->
<div v-if="followData.length === 0 && !loading" class="empty-container">
<Empty description="暂无关注用户" />
<Empty description="暂无关注用户,或Cookie设置中未设置SecUserId" />
</div>
</div>
</div>
@@ -305,15 +305,7 @@ const handleScroll = () => {
// 开关状态变更(启用/禁用用户)
const handleSwitchChange = (item, checked) => {
item.openSync = checked;
if (!checked) item.isEditing = false; // 禁用时关闭编辑状态
if (!checked) {
uploadSyncStatus(item);
} else {
if (item.savePath.length > 0) {
uploadSyncStatus(item);
}
}
};
// 全量同步开关变更
@@ -342,7 +334,6 @@ const handleSavePath = (item) => {
uploadSyncStatus(item);
};
const uploadSyncStatus = (item) => {
item.isSaving = true;
useApiStore()
.OpenOrCloseSync({
Id: item.id,
@@ -371,29 +362,7 @@ const uploadSyncStatus = (item) => {
//全量同步开关
const uploadFullSyncStatus = (item) => {
item.isSaving = true;
useApiStore()
.OpenOrCloseFullSync({
Id: item.id,
OpenSync: item.openSync,
FullSync: item.fullSync,
SavePath: item.savePath, // 保持原有逻辑:提交 savePath
})
.then((res) => {
if (res.code === 0) {
message.success(`保存成功,将在下次任务执行时生效`);
item.isEditing = false; // 保存成功后关闭编辑状态
} else {
message.error('保存失败' + (res.msg || '未知错误'));
}
})
.catch((err) => {
console.error('保存失败', err);
message.error('保存失败,请重试');
})
.finally(() => {
// 接口响应结束:解除禁用(无论成功失败)
item.isSaving = false;
});
uploadSyncStatus(item);
};
// 批量同步所有用户
+36 -11
View File
@@ -44,10 +44,14 @@
<!-- 模板相关配置只有关闭"标题当文件名"时才显示 -->
<a-form-item has-feedback label="定义标题模板" name="FollowedTitleTemplate" :wrapper-col="{ span: 12 }" v-if="!formState.UperUseViedoTitle">
<a-select v-model:value="formState.FollowedTitleTemplate" :options="template_options" mode="multiple" size="middle" placeholder="请选择"></a-select>
<a-select v-model:value="formState.FollowedTitleTemplate" :options="template_options" mode="multiple" size="middle" placeholder="请选择占位符组合"></a-select>
<div class="flex items-start mt-1 text-sm text-gray-500">
<InfoCircleOutlined class="text-blue-400 mr-1 mt-0.5" />
<span>选择生成文件名的占位符顺序即为文件名顺序需配合分隔符使用</span>
<span>
选择生成文件名的占位符顺序即为文件名顺序需配合分隔符使用<br />
<strong class="text-gray-700">占位符说明</strong>
{Id}=视频ID{VideoTitle}=视频标题{ReleaseTime}=发布时间{Author}=博主名称{FileHash}=文件哈希{Resolution}=分辨率
</span>
</div>
</a-form-item>
@@ -55,13 +59,23 @@
<a-input v-model:value="formState.FollowedTitleSeparator" placeholder="请输入分隔符(如 - _ 或空)" style="width: 200px" />
<div class="flex items-start mt-1 text-sm text-gray-500">
<InfoCircleOutlined class="text-blue-400 mr-1 mt-0.5" />
<span>占位符之间的连接符-_为空则直接拼接</span>
<span>
占位符之间的连接符-_.为空则直接拼接<br />
<strong class="text-gray-700">示例</strong>选择{Author}{VideoTitle}分隔符填-将生成博主名称-视频标题格式文件名
</span>
</div>
</a-form-item>
<!-- 完整模板预览只有关闭"标题当文件名"时才显示 -->
<a-form-item label="完整模板预览" :wrapper-col="{ span: 12 }" v-if="!formState.UperUseViedoTitle">
<a-input v-model:value="formState.FullFollowedTitleTemplate" placeholder="最终的模板" disabled style="background: #f5f5f5" />
<div class="flex items-start mt-1 text-sm text-gray-500">
<InfoCircleOutlined class="text-blue-400 mr-1 mt-0.5" />
<span>
实时展示您选择的占位符和分隔符组合效果<br />
<strong class="text-gray-700">示例</strong>选择{Author}{ReleaseTime}{Id}分隔符填_预览结果为博主名称_20250101_123456
</span>
</div>
</a-form-item>
</div>
@@ -150,20 +164,19 @@ import type { Rule } from 'ant-design-vue/es/form';
import type { FormInstance } from 'ant-design-vue';
import { useApiStore } from '@/store';
import { message } from 'ant-design-vue';
import { InfoCircleOutlined } from '@ant-design/icons-vue';
import { InfoCircleOutlined, SaveOutlined, CheckOutlined } from '@ant-design/icons-vue';
// 表单引用
const formRef = ref<FormInstance>();
// 模板字段:结构化数组
const template_options = [
{ label: '{Id}', value: '{Id}' },
{ label: '{VideoTitle}', value: '{VideoTitle}' },
{ label: '{FileHash}', value: '{FileHash}' },
// { label: '{FileSize}', value: '{FileSize}' },
{ label: '{Resolution}', value: '{Resolution}' },
// { label: '{SyncTime}', value: '{SyncTime}' },
{ label: '{ReleaseTime}', value: '{ReleaseTime}' },
{ label: '{Id} (视频ID)', value: '{Id}' },
{ label: '{VideoTitle} (视频标题)', value: '{VideoTitle}' },
{ label: '{ReleaseTime} (发布时间)', value: '{ReleaseTime}' },
{ label: '{Author} (博主名称)', value: '{Author}' },
{ label: '{FileHash} (文件哈希)', value: '{FileHash}' },
{ label: '{Resolution} (分辨率)', value: '{Resolution}' },
];
// 状态定义
@@ -415,4 +428,16 @@ const onCancel = () => {
:deep(.ant-input-disabled) {
color: #666 !important;
}
// 模板选择器选项样式优化
:deep(.ant-select-item-option-content) {
display: flex;
align-items: center;
}
// 提示信息中的强调文本样式
:deep(.text-gray-700) {
color: #444 !important;
font-weight: 500;
}
</style>
+21
View File
@@ -210,7 +210,28 @@ export const useApiStore = defineStore('coreapi', () => {
});
}
//当前版本
async function MyTag() {
return http.request<any, Response<any>>('/api/config/mytag', 'get').then(r => {
return r.data;
}).finally(() => {
});
}
//检查版本
async function CheckTag() {
return http.request<any, Response<any>>('/api/config/checktag', 'get').then(r => {
return r.data;
}).finally(() => {
});
}
return {
CheckTag,
MyTag,
deleteCookie,
UpdateConfig,
apiCheckInitStatus,
+2 -1
View File
@@ -1,5 +1,6 @@
{
"dbconn": "",
"dbtype": "Sqlite",
"DOWN_IMGVIDEO": "1"
"DOWN_IMGVIDEO": "1",
"tagName": "beta_1.5.7"
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 419 KiB

+108
View File
@@ -0,0 +1,108 @@
namespace dy.net.dto
{
//如果好用,请收藏地址,帮忙分享。
public class ImageTagInfoItem
{
/// <summary>
///
/// </summary>
public string Architecture { get; set; }
/// <summary>
///
/// </summary>
public string Author { get; set; }
/// <summary>
///
/// </summary>
public string CreationTime { get; set; }
/// <summary>
///
/// </summary>
public string DockerVersion { get; set; }
/// <summary>
///
/// </summary>
public string DurationDays { get; set; }
/// <summary>
///
/// </summary>
public int Id { get; set; }
/// <summary>
///
/// </summary>
public string ImageId { get; set; }
/// <summary>
///
/// </summary>
public string Kind { get; set; }
/// <summary>
///
/// </summary>
public string OS { get; set; }
/// <summary>
///
/// </summary>
public string PushTime { get; set; }
/// <summary>
///
/// </summary>
public string Size { get; set; }
/// <summary>
///
/// </summary>
public int SizeByte { get; set; }
/// <summary>
///
/// </summary>
public string TagId { get; set; }
/// <summary>
///
/// </summary>
public string TagName { get; set; }
/// <summary>
///
/// </summary>
public string UpdateTime { get; set; }
}
public class ImageData
{
/// <summary>
///
/// </summary>
public string RepoName { get; set; }
/// <summary>
///
/// </summary>
public string Server { get; set; }
/// <summary>
///
/// </summary>
public int TagCount { get; set; }
/// <summary>
///
/// </summary>
public List<ImageTagInfoItem> TagInfo { get; set; }
}
public class ImageResponse
{
/// <summary>
///
/// </summary>
public ImageData Data { get; set; }
/// <summary>
///
/// </summary>
public string RequestId { get; set; }
}
public class TenImageApiResponse
{
/// <summary>
///
/// </summary>
public ImageResponse Response { get; set; }
}
}
+1 -1
View File
@@ -19,7 +19,7 @@
/// <summary> 对应 {Resolution}(分辨率,如 1920x1080 </summary>
public string Resolution { get; set; } = string.Empty;
public string Author { get; set; } = string.Empty;
/// <summary> 对应 {FileSize}(文件大小,单位:字节) </summary>
//public long FileSize { get; set; } = 0;
}
+10 -4
View File
@@ -23,15 +23,19 @@
<ItemGroup>
<Compile Remove="app\**" />
<Compile Remove="db\**" />
<Compile Remove="expand\**" />
<Compile Remove="logs\**" />
<Content Remove="app\**" />
<Content Remove="db\**" />
<Content Remove="expand\**" />
<Content Remove="logs\**" />
<EmbeddedResource Remove="app\**" />
<EmbeddedResource Remove="db\**" />
<EmbeddedResource Remove="expand\**" />
<EmbeddedResource Remove="logs\**" />
<None Remove="app\**" />
<None Remove="db\**" />
<None Remove="expand\**" />
<None Remove="logs\**" />
</ItemGroup>
@@ -64,7 +68,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="db\" />
<Folder Include="wwwroot\" />
</ItemGroup>
@@ -74,9 +77,12 @@
</ItemGroup>
<ItemGroup>
<None Update="db\dy.sqlite">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Reference Include="dy.sync.lib">
<HintPath>lib\dy.sync.lib.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Update="Dockerfile">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
+1
View File
@@ -414,6 +414,7 @@ namespace dy.net.job
{
if (File.Exists(exitVideo.VideoSavePath))
{
Serilog.Log.Debug($"视频-{exitVideo.AwemeId}-[{exitVideo.VideoTitle}]已存在,跳过");
continue;// 已存在则跳过
}
}
+2 -1
View File
@@ -128,7 +128,8 @@ namespace dy.net.job
Id = item.AwemeId,
ReleaseTime = DateTimeUtil.Convert10BitTimestamp(item.CreateTime),
Resolution = $"{Width}×{Height}",
VideoTitle = DouyinFileNameHelper.GenerateFileName(item.Desc, item.AwemeId)
VideoTitle = DouyinFileNameHelper.GenerateFileName(item.Desc, item.AwemeId),
Author = item.Author.Nickname
});
fileName= $"{DouyinFileNameHelper.SanitizePath(fullName)}.{Format}";
Binary file not shown.
+1
View File
@@ -14,6 +14,7 @@ namespace dy.net.model
/// <summary>
/// 用户抖音ID,对应我关注信息里面的myself_user_id
/// </summary>
[SugarColumn(Length =500,IsNullable =true)]
public string MyUserId { get; set; }
/// <summary>
/// 用户描述
+6
View File
@@ -36,5 +36,11 @@ namespace dy.net.repository
return (list, totalCount);
}
public DouyinCookie GetDefault()
{
return Db.Queryable<DouyinCookie>()
.First();
}
}
}
+2 -1
View File
@@ -59,7 +59,8 @@ namespace dy.net.service
ImageViedoSaveAlone = true,
FollowedTitleTemplate ="",
FullFollowedTitleTemplate="",
FollowedTitleSeparator=""
FollowedTitleSeparator="",
AutoDistinct=true,//默认开启
};
sqlSugarClient.Insertable(config).ExecuteCommand();
return config;
+7 -5
View File
@@ -1,7 +1,9 @@
using dy.net.model;
using ClockSnowFlake;
using dy.net.model;
using dy.net.repository;
using SqlSugar;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace dy.net.service
{
@@ -28,18 +30,17 @@ namespace dy.net.service
public bool InitCookie()
{
var initId= "2026";
var exist = _cookieRepository.GetFirst(x => x.Id == initId);
var exist = _cookieRepository.GetDefault();
if (exist != null)
{
return false;
return true;
}
var cookie = new DouyinCookie
{
UserName = "douyin",
Cookies = "-",
SecUserId = "-",
Id = initId,
Id = IdGener.GetLong().ToString(),
Status = 0,
SavePath = "/app/collect",
FavSavePath = "/app/favorite",
@@ -48,6 +49,7 @@ namespace dy.net.service
CollHasSyncd = 0,
FavHasSyncd = 0,
UperSyncd = 0,
MyUserId=""
};
return _cookieRepository.Insert(cookie);
}
+34 -8
View File
@@ -213,25 +213,51 @@ namespace dy.net.service
Serilog.Log.Error(e, "数据库事务执行失败:Ids={0}", string.Join(",", videoIds));
});
// 5. 文件删除(非事务操作,失败不回滚数据库,可根据业务调整)
// 采用异步文件操作,避免同步IO阻塞线程(需.NET 5+支持
foreach (var path in filePathsToDelete)
// 5. 文件删除(非事务操作,失败不回滚数据库,可根据业务调整)
// 关键:先通过文件路径获取父文件夹,再删除整个文件夹(含子内容
foreach (var filePath in filePathsToDelete)
{
try
{
if (File.Exists(path))
// 1. 验证文件路径有效性
if (string.IsNullOrWhiteSpace(filePath))
{
File.Delete(path); // 异步删除,提升并发性能
Serilog.Log.Debug("视频文件删除成功:Path={0}", path);
Serilog.Log.Error("文件路径为空,跳过文件夹删除");
continue;
}
// 2. 获取文件对应的父文件夹路径(无论文件是否存在,只要路径合法就能拿到父目录)
string parentDirPath = Path.GetDirectoryName(filePath);
if (string.IsNullOrWhiteSpace(parentDirPath))
{
Serilog.Log.Error("无法获取父文件夹路径,文件路径无效:Filepath={0}", filePath);
continue;
}
// 3. 验证父文件夹是否存在
if (Directory.Exists(parentDirPath))
{
Directory.Delete(parentDirPath, recursive: true);
Serilog.Log.Debug("文件夹删除成功(含子内容):ParentDir={0},关联文件路径={1}", parentDirPath, filePath);
}
else
{
Serilog.Log.Error("视频文件不存在,跳过删除:Path={0}", path);
Serilog.Log.Error("文件不存在,跳过删除:ParentDir={0},关联文件路径={1}", parentDirPath, filePath);
}
}
catch (IOException ex)
{
Serilog.Log.Error(ex, "视频文件删除失败Path={0}", path);
Serilog.Log.Error(ex, "文件删除失败IO异常):Filepath={0},父文件夹路径={1}", filePath, Path.GetDirectoryName(filePath));
}
catch (UnauthorizedAccessException ex)
{
// 单独捕获权限异常,更精准的日志提示
Serilog.Log.Error(ex, "文件夹删除失败(权限不足):Filepath={0},父文件夹路径={1}", filePath, Path.GetDirectoryName(filePath));
}
catch (Exception ex)
{
// 捕获所有其他异常,避免循环中断
Serilog.Log.Error(ex, "文件夹删除失败(未知异常):Filepath={0},父文件夹路径={1}", filePath, Path.GetDirectoryName(filePath));
}
}
+2 -2
View File
@@ -96,7 +96,7 @@ namespace dy.net.utils
// 步骤6:移除首尾无效字符(分隔符、点号)
title = title.Replace(" ","").Trim(Separator, '.');
title = title.Replace("--", "-");//避免多个连续----
// 容错:如果净化后为空,返回默认值
return string.IsNullOrWhiteSpace(title) ? id : title;
}
@@ -151,7 +151,7 @@ namespace dy.net.utils
//string emojiPattern = @"[\u1F600-\u1F64F\u1F300-\u1F5FF\u1F680-\u1F6FF\u1E000-\u1EFFF\u2600-\u2B55\u200D]";
//path = Regex.Replace(path, emojiPattern, "", RegexOptions.Compiled);
path = Regex.Replace(path, @"[^a-zA-Z0-9\u4e00-\u9fa5]", "-");
path = path.Replace("--", "-");//避免重复---
foreach (var c in Path.GetInvalidFileNameChars())
{
path = path.Replace(c, '_');
+3 -2
View File
@@ -20,7 +20,7 @@ namespace dy.net.utils
public static string Generate(
string template,
VideoTitleDataTemplate data,
string timeFormat = "yyyyMMddHHmmss",
string timeFormat = "yyyyMMdd",
string emptyPlaceholder = "")
{
// 校验入参
@@ -36,6 +36,7 @@ namespace dy.net.utils
["VideoTitle"] = string.IsNullOrWhiteSpace(data.VideoTitle) ? emptyPlaceholder : data.VideoTitle,
["FileHash"] = string.IsNullOrWhiteSpace(data.FileHash) ? emptyPlaceholder : data.FileHash,
["Resolution"] = string.IsNullOrWhiteSpace(data.Resolution) ? emptyPlaceholder : data.Resolution,
["Author"] = string.IsNullOrWhiteSpace(data.Author) ? emptyPlaceholder : data.Author,
// 时间字段(支持空值处理)
//["SyncTime"] = data.SyncTime.HasValue ? data.SyncTime.Value.ToString(timeFormat) : emptyPlaceholder,
@@ -54,7 +55,7 @@ namespace dy.net.utils
return placeholderMap.TryGetValue(placeholderKey, out var value) ? value : match.Value;
});
return finalTitle;
return finalTitle.Replace("--","-");
}
/// <summary>