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' }) + } }); }