diff --git a/Controllers/ConfigController.cs b/Controllers/ConfigController.cs index 1980b54..72e1672 100644 --- a/Controllers/ConfigController.cs +++ b/Controllers/ConfigController.cs @@ -151,6 +151,38 @@ namespace dy.net.Controllers } + /// + /// 配合工具自动设置cookie + /// + /// + /// + [HttpPost("FastResetCookie")] + [AllowAnonymous] + public async Task FastResetCookie([FromBody] DouyinCookieResetDto dto) + { + var cookieValid = await httpClientService.CheckCookie(new DouyinCookie { Cookies = dto.cookie }); + if (!cookieValid) + return ApiResult.Fail("Cookie无效或已过期,请按照文档提示重新获取有效Cookie,不要使用插件获取cookie"); + var result = await dyCookieService.FastResetCookie(dto.id, dto.cookie); + + return result ? ApiResult.Success() : ApiResult.Fail("cookie设置失败"); + } + + /// + /// 配合工具自动设置cookie,获取当前设置的所有Cookie + /// + /// + [AllowAnonymous] + [HttpGet("Cookies")] + public async Task GetAllCookies() + { + var cookies = await dyCookieService.GetAllAsync(); + if (cookies != null) + return ApiResult.Success(cookies.Select(x => new { id= x.Id,name= x.UserName, status=x.StatusMsg })); + return ApiResult.Success(); + } + + /// /// 非docker初始化 /// diff --git a/Properties/PublishProfiles/docker.pubxml b/Properties/PublishProfiles/docker.pubxml index ce0d800..eb42734 100644 --- a/Properties/PublishProfiles/docker.pubxml +++ b/Properties/PublishProfiles/docker.pubxml @@ -17,6 +17,6 @@ false - + \ No newline at end of file diff --git a/README.md b/README.md index 27662af..2966be4 100644 --- a/README.md +++ b/README.md @@ -95,8 +95,9 @@ Cookie 及 `sec_user_id` 是同步功能的核心,需严格按步骤获取, | 镜像标签 | 架构 | | ----------------- | -------------- | -| `beta_2.1.8` | x86_64 (amd64) | -| `arm_2.1.8` | ARM64 | +| `beta_2.2.0` | x86_64 (amd64) | +| `arm_2.2.0` | ARM64 | +| `latest` | x86_64 (amd64) | ### 构建命令示例 @@ -113,7 +114,7 @@ Cookie 及 `sec_user_id` 是同步功能的核心,需严格按步骤获取, services: dysync: - image: ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_2.1.8 + image: ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_2.2.0 container_name: dysync2026 # 容器名称 restart: unless-stopped # 始终重启容器,除非容器被手动停止或Docker服务停止 ports: diff --git a/dy.cookie.exe b/dy.cookie.exe new file mode 100644 index 0000000..675b300 Binary files /dev/null and b/dy.cookie.exe differ diff --git a/dy.net.csproj b/dy.net.csproj index 35c60d8..21299cd 100644 --- a/dy.net.csproj +++ b/dy.net.csproj @@ -131,7 +131,7 @@ - +