From 270f5e01992fba8fa95acc738d7f2b3877794339 Mon Sep 17 00:00:00 2001 From: HoshinoSuzumi Date: Thu, 11 Apr 2024 18:03:48 +0800 Subject: [PATCH] feat: chat login --- pages/aigc/chat/index.vue | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/pages/aigc/chat/index.vue b/pages/aigc/chat/index.vue index 4a3328f..aca6c2a 100644 --- a/pages/aigc/chat/index.vue +++ b/pages/aigc/chat/index.vue @@ -10,10 +10,10 @@ import { llmModels, type ModelTag, } from '~/typings/llm' -import {useHistory} from '~/composables/useHistory' -import {uuidv4} from '@uniiem/uuid' -import {useLLM} from '~/composables/useLLM' -import {trimObject} from '@uniiem/object-trim' +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' import NewSessionScreen from '~/components/aigc/chat/NewSessionScreen.vue' @@ -26,8 +26,8 @@ const toast = useToast() const modal = useModal() const loginState = useLoginState() const historyStore = useHistory() -const {chatSessions} = storeToRefs(historyStore) -const {setChatSessions} = historyStore +const { chatSessions } = storeToRefs(historyStore) +const { setChatSessions } = historyStore const currentSessionId = ref(null) const messagesWrapperRef = ref(null) @@ -123,7 +123,7 @@ const createSession = (assistant: Assistant | null) => { insetMessage({ id: uuidv4(), role: 'user', - content: `${currentAssistant.value?.target},${currentAssistant.value?.demand}`, + content: `${ currentAssistant.value?.target },${ currentAssistant.value?.demand }`, preset: true, }) insetMessage({ @@ -267,7 +267,7 @@ onMounted(() => {
- + 没有会话
@@ -302,8 +302,18 @@ onMounted(() => {
+
+
+ +

请登录后使用

+ + 登录 + +
+