From cb4bf0e8d5ccb845dfccef93438cfb745ff84323 Mon Sep 17 00:00:00 2001 From: WanWanYun Date: Sun, 16 Nov 2025 00:22:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E8=AF=A6=E6=83=85=E5=8A=9F=E8=83=BD=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=97=A0=E5=8F=8D=E5=BA=94=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题描述: - 右键文件夹 → 点击"查看详情" - 菜单关闭但没有任何反应 - 详情弹窗不显示 根本原因: 在 contextMenuAction(action) 的 switch 语句中 **缺少 case 'info': 分支** 代码分析: ```javascript contextMenuAction(action) { switch (action) { case 'preview': ... case 'download': ... case 'rename': ... case 'share': ... // ❌ 直接跳到share,跳过了info case 'delete': ... } } ``` 修复方案: 在 rename 和 share 之间添加: ```javascript case 'info': this.showFolderInfo(this.contextMenuFile); break; ``` 修复后流程: 1. 右键文件夹 → "查看详情" 2. 触发 contextMenuAction('info') 3. 执行 showFolderInfo(file) 4. 调用后端 API: POST /api/files/folder-info 5. 显示详情弹窗(大小、文件数、子文件夹数) 之前为什么漏掉: 添加showFolderInfo方法时,忘记在contextMenuAction中注册该action 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- frontend/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/app.js b/frontend/app.js index 0790d2e..1b5bf0d 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1024,6 +1024,9 @@ handleDragLeave(e) { case 'rename': this.openRenameModal(this.contextMenuFile); break; + case 'info': + this.showFolderInfo(this.contextMenuFile); + break; case 'share': this.openShareFileModal(this.contextMenuFile); break;