From 200891c199482148d7d80de86b945b4dc1d04622 Mon Sep 17 00:00:00 2001 From: HoshinoSuzumi Date: Wed, 3 Apr 2024 16:04:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=81=8A=E5=A4=A9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=9C=AA=E7=99=BB=E5=BD=95=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/aigc/chat/index.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pages/aigc/chat/index.vue b/pages/aigc/chat/index.vue index e5593dd..e1be545 100644 --- a/pages/aigc/chat/index.vue +++ b/pages/aigc/chat/index.vue @@ -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(() => { - +