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(() => { - +