feat: 聊天页面未登录提示

This commit is contained in:
2024-04-03 16:04:26 +08:00
parent e02b0ffcc6
commit 200891c199

View File

@@ -13,6 +13,7 @@ import {useHistory} from "~/composables/useHistory";
import {uuidv4} from "@uniiem/uuid";
import {useLLM} from "~/composables/useLLM";
import {trimObject} from "@uniiem/object-trim";
import ModalAuthentication from "~/components/ModalAuthentication.vue";
useHead({
title: '聊天 | XSH AI'
@@ -20,6 +21,8 @@ useHead({
const dayjs = useDayjs()
const toast = useToast()
const modal = useModal()
const loginState = useLoginState()
const historyStore = useHistory()
const {chatSessions} = storeToRefs(historyStore)
const {setChatSessions} = historyStore
@@ -107,6 +110,10 @@ const handleClickCreateSession = () => {
* @param event
*/
const handleClickSend = (event: any) => {
if (!loginState.is_logged_in) {
modal.open(ModalAuthentication)
return;
}
if (event.ctrlKey) {
return;
}
@@ -299,7 +306,7 @@ onMounted(() => {
</div>
<!-- Modals -->
<UModal v-model="modals.modelSelect">
<UModal prevent-close v-model="modals.modelSelect">
<UCard>
<template #header>
<h3 class="text-base font-semibold leading-6 text-gray-900 dark:text-white">