From d5c48da08d0a413ac7b2db71511e87a771334d9f Mon Sep 17 00:00:00 2001 From: mengyxu Date: Tue, 20 May 2025 09:06:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=B2=98=E8=B4=B4=E5=AD=98?= =?UTF-8?q?=E6=A1=A3=E6=97=A0=E6=95=88BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/archive.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/views/archive.vue b/src/views/archive.vue index 099d754..81d96a4 100644 --- a/src/views/archive.vue +++ b/src/views/archive.vue @@ -107,11 +107,16 @@ const downArchive = () => { } const pasteArchive = () => { - navigator.clipboard.readText().then((text) => { - archive.value = text; - commit('set_sys_info', { msg: t('pasteArchive.1'), type: 'win' }) - }, () => { - commit('set_sys_info', { msg: t('pasteArchive.2'), type: 'waring' }) + const name: any = 'clipboard-read'; + navigator.permissions.query({ name: name }).then(result => { + if (result.state === 'granted') { + navigator.clipboard.readText().then(text => { + archive.value = text; + commit('set_sys_info', { msg: t('pasteArchive.1'), type: 'win' }) + }); + } else { + commit('set_sys_info', { msg: t('pasteArchive.2'), type: 'waring' }) + } }); }