diff --git a/.env.development.example b/.env.development.example index b7ca77488..6ab370024 100644 --- a/.env.development.example +++ b/.env.development.example @@ -22,5 +22,6 @@ VUE_APP_LOGOUT_PATH = '/core/auth/logout/' # Dev server for core proxy 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/index.vue b/src/components/Apps/ChatAi/components/ChitChat/index.vue index c8d856eb0..7a57685be 100644 --- a/src/components/Apps/ChatAi/components/ChitChat/index.vue +++ b/src/components/Apps/ChatAi/components/ChitChat/index.vue @@ -90,9 +90,10 @@ export default { }, methods: { initWebSocket() { + const api = '/kael/chat/system/' const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws' - const path = `${protocol}://${window.location.host}/kael/chat/system/` - const localPath = process.env.VUE_APP_KAEL_WS + '/kael/chat/system/' + 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 createWebSocket(url, this.onWebSocketMessage) }, @@ -174,15 +175,8 @@ export default { } }, onStopHandle() { - const { protocol, host } = window.location - const { NODE_ENV, VUE_APP_KAEL_WS } = process.env || {} - const api = '/kael/chat/system/interrupt_current_ask/' - const path = `${protocol}://${host}` - const index = VUE_APP_KAEL_WS.indexOf('//') - const localPath = protocol + VUE_APP_KAEL_WS.substring(index, VUE_APP_KAEL_WS.length) + api - const url = NODE_ENV === 'development' ? localPath : path this.$axios.post( - url, + '/kael/chat/system/interrupt_current_ask/', { id: this.currentConversationId || '' } ).finally(() => { removeLoadingMessageInChat() diff --git a/src/components/Apps/ChatAi/components/Sidebar/index.vue b/src/components/Apps/ChatAi/components/Sidebar/index.vue index 063be26d1..5a8d5ba4e 100644 --- a/src/components/Apps/ChatAi/components/Sidebar/index.vue +++ b/src/components/Apps/ChatAi/components/Sidebar/index.vue @@ -1,12 +1,16 @@