From 54b87016442c87efbb747cef123893973f7c78a0 Mon Sep 17 00:00:00 2001 From: Julian Freeman Date: Fri, 17 Apr 2026 12:10:24 -0400 Subject: [PATCH] alert before clean recycle.bin --- src/App.vue | 6 +++++- src/composables/useFastClean.ts | 26 ++++++++++++++++++++++++-- src/pages/FastCleanPage.vue | 8 ++++++-- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/App.vue b/src/App.vue index 0bb4ba5..73d9c66 100644 --- a/src/App.vue +++ b/src/App.vue @@ -139,7 +139,11 @@ async function searchNode(provider: "google" | "perplexity") { />
- + void) { +export function useFastClean( + showAlert: (options: AlertOptions) => void, + requestConfirm: (options: ConfirmOptions) => Promise, +) { const state = ref({ isScanning: false, isCleaning: false, @@ -82,6 +90,20 @@ export function useFastClean(showAlert: (options: AlertOptions) => void) { return; } + if (selectedPaths.includes("C:\\$Recycle.Bin")) { + const confirmed = await requestConfirm({ + title: "确认清空回收站", + message: "当前勾选项包含回收站。\n\n清空后,回收站中的文件将被永久删除,通常无法直接恢复。\n\n是否继续清理?", + type: "info", + confirmText: "继续清理", + cancelText: "返回检查", + }); + + if (!confirmed) { + return; + } + } + current.isCleaning = true; try { current.cleanResult = await runFastCleanCommand(selectedPaths); diff --git a/src/pages/FastCleanPage.vue b/src/pages/FastCleanPage.vue index f2593c4..7ff1326 100644 --- a/src/pages/FastCleanPage.vue +++ b/src/pages/FastCleanPage.vue @@ -1,13 +1,17 @@