From 9592a61e72b486a919b388975730aef050143f41 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Fri, 18 Apr 2025 18:51:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/helper/hooks/plugin.ts | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/modules/helper/hooks/plugin.ts b/src/modules/helper/hooks/plugin.ts index 25e271b..7b395b8 100644 --- a/src/modules/helper/hooks/plugin.ts +++ b/src/modules/helper/hooks/plugin.ts @@ -18,18 +18,20 @@ export const usePlugin = () => { if (e.dataTransfer) { const file = e.dataTransfer.files[0]; - ElMessageBox.confirm( - t('检测到插件「{name}」,是否安装?', { name: getName(file) }), - t('提示'), - { - type: 'warning', - confirmButtonText: t('安装') - } - ) - .then(() => { - install(file); - }) - .catch(() => null); + if (file.name.endsWith('.cool')) { + ElMessageBox.confirm( + t('检测到插件「{name}」,是否安装?', { name: getName(file) }), + t('提示'), + { + type: 'warning', + confirmButtonText: t('安装') + } + ) + .then(() => { + install(file); + }) + .catch(() => null); + } } }); }