提交 ff38dbc1 编写于 作者: D DebugIsFalse

fix: 分享

上级 af9dcdef
......@@ -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)
}
</script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册