From ff38dbc1596a38fe1a221089fda21c992c00b9ff Mon Sep 17 00:00:00 2001 From: DebugIsFalse <511418503@qq.com> Date: Tue, 28 May 2024 17:46:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/i/search/Header.vue | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/components/i/search/Header.vue b/components/i/search/Header.vue index 9e3e01b..02b3698 100644 --- a/components/i/search/Header.vue +++ b/components/i/search/Header.vue @@ -100,11 +100,6 @@ function handleBlurTitle () { } function handleShare (isUpdate) { const shareType = String(isOpen.value) - toast.add({ - icon: 'i-heroicons-information-circle-20-solid', - timeout: 2000, - title: '链接已复制到剪贴板' - }) isUpdate && useRequest(`/v1/chat/${route.params.id}/public/${shareType}`, { method: 'post' }) } @@ -114,9 +109,18 @@ function handleUpdateOpenState (state) { handleShare(updateOpened) } function handleSetOpenState() { + useCopyToClipboard().copy(window.location.href) + const isUpdate = !isOpen.value if (!isOpen.value) { isOpen.value = true - handleShare(true) } + setTimeout(() => { + toast.add({ + icon: 'i-heroicons-information-circle-20-solid', + timeout: 2000, + title: '链接已复制到剪贴板' + }) + handleShare(isUpdate) + }, 500) } \ No newline at end of file -- GitLab