From 1ff250fa17726572a9a1f3f4237b38bab1748fe3 Mon Sep 17 00:00:00 2001 From: fish Date: Wed, 15 Jul 2026 22:51:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=89=AA=E8=B4=B4=E6=9D=BF?= =?UTF-8?q?=E6=97=A0=E6=95=88=E5=8D=A0=E4=BD=8D=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Note/SaveClipIntent.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Note/SaveClipIntent.swift b/Note/SaveClipIntent.swift index 24014b2..3d12966 100644 --- a/Note/SaveClipIntent.swift +++ b/Note/SaveClipIntent.swift @@ -31,7 +31,22 @@ struct SaveClipIntent: AppIntent { return .result(value: "文案为空,未保存。") } + guard !isSystemClipboardPlaceholder(trimmed) else { + return .result(value: "剪贴板没有有效文本,未保存。") + } + try await ClipStore.shared.save(text: trimmed, source: source) return .result(value: "已保存到收集箱。") } + + private func isSystemClipboardPlaceholder(_ text: String) -> Bool { + let lowercased = text.lowercased() + if lowercased.hasPrefix("clipboard ") && lowercased.contains(" at ") { + return true + } + if text == "获取剪贴板" { + return true + } + return false + } }