diff --git a/.env.development.example b/.env.development.example index 6ab370024..409d8e846 100644 --- a/.env.development.example +++ b/.env.development.example @@ -23,5 +23,4 @@ VUE_APP_LOGOUT_PATH = '/core/auth/logout/' VUE_APP_CORE_HOST = 'http://localhost:8080' VUE_APP_CORE_WS = 'ws://localhost:8080' VUE_APP_KAEL_HOST = 'http://localhost:8083' -VUE_APP_KAEL_WS = 'ws://localhost:8083' VUE_APP_ENV = 'development' diff --git a/src/components/Apps/ChatAi/components/ChitChat/ChatMessage.vue b/src/components/Apps/ChatAi/components/ChitChat/ChatMessage.vue index 3c9d0ec98..762655f33 100644 --- a/src/components/Apps/ChatAi/components/ChitChat/ChatMessage.vue +++ b/src/components/Apps/ChatAi/components/ChitChat/ChatMessage.vue @@ -14,7 +14,7 @@ {{ item.message.content }} - + diff --git a/src/components/Apps/ChatAi/components/ChitChat/MessageText.vue b/src/components/Apps/ChatAi/components/ChitChat/MessageText.vue index e829601a0..01cacc41e 100644 --- a/src/components/Apps/ChatAi/components/ChitChat/MessageText.vue +++ b/src/components/Apps/ChatAi/components/ChitChat/MessageText.vue @@ -34,13 +34,13 @@ export default { computed: { text() { const value = this.message?.content || '' - if (value) { - return this.markdown.render(value) + if (value && this.markdown) { + return this.markdown?.render(value) } return value } }, - created() { + mounted() { this.init() }, updated() { diff --git a/src/components/Apps/ChatAi/components/ChitChat/index.vue b/src/components/Apps/ChatAi/components/ChitChat/index.vue index 7a57685be..43f825bcd 100644 --- a/src/components/Apps/ChatAi/components/ChitChat/index.vue +++ b/src/components/Apps/ChatAi/components/ChitChat/index.vue @@ -14,6 +14,8 @@ + +
{{ $tc('common.Stop') }} -
-
@@ -90,11 +90,13 @@ export default { }, methods: { initWebSocket() { + const { NODE_ENV, VUE_APP_KAEL_HOST } = process.env const api = '/kael/chat/system/' const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws' const path = `${protocol}://${window.location.host}${api}` - const localPath = process.env.VUE_APP_KAEL_WS + api - const url = process.env.NODE_ENV === 'development' ? localPath : path + const index = VUE_APP_KAEL_HOST.indexOf('://') + const localPath = protocol + VUE_APP_KAEL_HOST.substring(index, VUE_APP_KAEL_HOST.length) + api + const url = NODE_ENV === 'development' ? localPath : path createWebSocket(url, this.onWebSocketMessage) }, initChatMessage() { @@ -176,7 +178,7 @@ export default { }, onStopHandle() { this.$axios.post( - '/kael/chat/system/interrupt_current_ask/', + '/kael/chat/interrupt_current_ask/', { id: this.currentConversationId || '' } ).finally(() => { removeLoadingMessageInChat() @@ -223,21 +225,23 @@ export default { padding: 0 15px; overflow-y: auto; user-select: text; - .stop { - position: absolute; - bottom: 6px; - left: 50%; - transform: translateX(-50%); - >>> i { - margin-right: 4px; - } - } } .input-box { + position: relative; height: 154px; padding: 0 15px; margin-bottom: 15px; border-top: 1px solid #ececec; } + .stop { + position: absolute; + top: -36px; + left: 50%; + z-index: 11; + transform: translateX(-50%); + >>> i { + margin-right: 4px; + } + } }