From b4375d22d52e694574575a287675257bc5abc82f Mon Sep 17 00:00:00 2001 From: yuming Date: Sat, 4 Jul 2026 18:32:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B8=85=E7=90=86=E4=B8=A4=E4=B8=AA=20C?= =?UTF-8?q?ontroller=20=E9=87=8C=20upstream=20=E6=AE=8B=E7=95=99=E7=9A=84?= =?UTF-8?q?=E5=AD=A4=E5=84=BF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - VideoController.cs 删除 GetAllCategories 方法(调用不存在的 dyCollectVideoService.GetAllCategoriesAsync) - ConfigController.cs 删除 GetQrCode/GetQrStatus/BindQrCode 三个 扫码相关方法(引用已删除的 _qrCodeService) 都是 cf40a7e merge 用 -X theirs 时保留下来但无法编译的孤儿。 feature 分支上这些方法本来就不存在(新架构不含此功能)。 Co-Authored-By: Claude Opus 4.7 (1M context) --- Controllers/ConfigController.cs | 78 --------------------------------- Controllers/VideoController.cs | 15 ------- 2 files changed, 93 deletions(-) diff --git a/Controllers/ConfigController.cs b/Controllers/ConfigController.cs index 05888f9..f794573 100644 --- a/Controllers/ConfigController.cs +++ b/Controllers/ConfigController.cs @@ -405,84 +405,6 @@ namespace dy.net.Controllers } - /// - /// 获取抖音扫码登录二维码 - /// - [HttpGet("qrcode")] - [Authorize] - public async Task GetQrCode() - { - try - { - var (token, qrBase64) = await _qrCodeService.GetQrCodeAsync(); - return Ok(new { code = 0, data = new { token, qrBase64 } }); - } - catch (Exception ex) - { - Serilog.Log.Error($"获取二维码失败: {ex.Message}"); - return Ok(new { code = -1, error = "获取二维码失败:" + ex.Message }); - } - } - - /// - /// 轮询扫码状态(前端每2秒调一次) - /// status: 1=待扫码, 2=已扫码待确认, 3=登录成功, -1=已过期 - /// - [HttpGet("qrstatus")] - [Authorize] - public async Task GetQrStatus([FromQuery] string token) - { - try - { - var (status, cookies, secUserId) = await _qrCodeService.CheckStatusAsync(token); - return Ok(new { code = 0, data = new { status, hasCookies = !string.IsNullOrEmpty(cookies), secUserId } }); - } - catch (Exception ex) - { - Serilog.Log.Error($"查询扫码状态失败: {ex.Message}"); - return Ok(new { code = -1, error = "查询失败:" + ex.Message }); - } - } - - /// - /// 扫码成功后,将 Cookie 绑定到指定账号 - /// - [HttpPost("qrbind")] - [Authorize] - public async Task BindQrCode([FromQuery] string token, [FromQuery] string id) - { - try - { - var (cookies, secUserId) = _qrCodeService.GetSessionResult(token); - if (string.IsNullOrEmpty(cookies)) - return Ok(new { code = -1, error = "扫码尚未完成或已过期" }); - - var account = await dyCookieService.GetByIdAsync(id); - if (account == null) - return Ok(new { code = -1, error = "账号不存在" }); - - account.Cookies = cookies; - if (!string.IsNullOrEmpty(secUserId)) - account.SecUserId = secUserId; - account.Status = 1; - - var result = await dyCookieService.UpdateAsync(account); - _qrCodeService.RemoveSession(token); - - if (result) - { - await ReStartJob(); - return Ok(new { code = 0, data = new { secUserId } }); - } - return Ok(new { code = -1, error = "保存失败" }); - } - catch (Exception ex) - { - Serilog.Log.Error($"绑定Cookie失败: {ex.Message}"); - return Ok(new { code = -1, error = "绑定失败:" + ex.Message }); - } - } - private void ReStartJob() { var config = commonService.GetConfig(); diff --git a/Controllers/VideoController.cs b/Controllers/VideoController.cs index dbc9db5..72c5593 100644 --- a/Controllers/VideoController.cs +++ b/Controllers/VideoController.cs @@ -36,21 +36,6 @@ namespace dy.net.Controllers pageSize = dto.PageSize }); } - - /// - /// 获取所有视频类型列表(用于下拉框) - /// - /// - [HttpGet("categories")] - public async Task GetAllCategories() - { - var categories = await dyCollectVideoService.GetAllCategoriesAsync(); - return Ok(new - { - code = 0, - data = categories - }); - } /// /// 查询统计数据