提交 ff38dbc1 编写于 作者: D DebugIsFalse

fix: 分享

上级 af9dcdef
...@@ -100,11 +100,6 @@ function handleBlurTitle () { ...@@ -100,11 +100,6 @@ function handleBlurTitle () {
} }
function handleShare (isUpdate) { function handleShare (isUpdate) {
const shareType = String(isOpen.value) 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' }) isUpdate && useRequest(`/v1/chat/${route.params.id}/public/${shareType}`, { method: 'post' })
} }
...@@ -114,9 +109,18 @@ function handleUpdateOpenState (state) { ...@@ -114,9 +109,18 @@ function handleUpdateOpenState (state) {
handleShare(updateOpened) handleShare(updateOpened)
} }
function handleSetOpenState() { function handleSetOpenState() {
useCopyToClipboard().copy(window.location.href)
const isUpdate = !isOpen.value
if (!isOpen.value) { if (!isOpen.value) {
isOpen.value = true isOpen.value = true
handleShare(true)
} }
setTimeout(() => {
toast.add({
icon: 'i-heroicons-information-circle-20-solid',
timeout: 2000,
title: '链接已复制到剪贴板'
})
handleShare(isUpdate)
}, 500)
} }
</script> </script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册