提交 6ebddb44 编写于 作者: D DebugIsFalse

Update Header.vue

上级 a062186f
......@@ -92,20 +92,20 @@ function handleBlurTitle () {
isEditTitle.value = false
emits('update-query', editTitle.value)
}
async function handleShare () {
function handleShare (isUpdate) {
const shareType = String(isOpen.value)
const { error } = await useRequest(`/v1/chat/${route.params.id}/public/${shareType}`, { method: 'post' })
if (!error.value && isOpen.value) {
useCopyToClipboard().copy(window.location.href)
toast.add({
icon: 'i-heroicons-information-circle-20-solid',
timeout: 2000,
title: '链接已复制到剪贴板'
})
}
useCopyToClipboard().copy(window.location.href)
toast.add({
icon: 'i-heroicons-information-circle-20-solid',
timeout: 2000,
title: '链接已复制到剪贴板'
})
isUpdate && useRequest(`/v1/chat/${route.params.id}/public/${shareType}`, { method: 'post' })
}
function handleUpdateOpenState (state) {
const updateOpened = isOpen.value !== state
isOpen.value = state
handleShare()
handleShare(updateOpened)
}
</script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册