refactor(frontend): 优化可组合函数

- 改进 useClipboard, useFormDialog, useTTLAnalysis composables
This commit is contained in:
fawney19
2025-12-12 20:22:09 +08:00
parent 113441780e
commit 79089debe4
3 changed files with 7 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
import { useToast } from './useToast'
import { log } from '@/utils/logger'
export function useClipboard() {
const { success, error: showError } = useToast()
@@ -33,7 +34,7 @@ export function useClipboard() {
document.body.removeChild(textArea)
}
} catch (err) {
console.error('复制失败:', err)
log.error('复制失败:', err)
showError('复制失败,请手动选择文本进行复制')
return false
}