perf: 修改 chatai

This commit is contained in:
ibuler 2024-04-29 18:58:16 +08:00
parent a3c387d445
commit 63c02eb14a
3 changed files with 11 additions and 9 deletions

View File

@ -31,9 +31,9 @@ import VueLogger from 'vuejs-logger'
import loggerOptions from './utils/logger' import loggerOptions from './utils/logger'
import ECharts from 'vue-echarts' import ECharts from 'vue-echarts'
import service from '@/utils/request' import service from '@/utils/request'
import request from '@/utils/request'
import { message } from '@/utils/message' import { message } from '@/utils/message'
import xss from '@/utils/xss' import xss from '@/utils/xss'
import request from '@/utils/request'
import ElTableTooltipPatch from '@/utils/elTableTooltipPatch.js' import ElTableTooltipPatch from '@/utils/elTableTooltipPatch.js'
/** /**
@ -94,7 +94,8 @@ new Vue({
;(function() { ;(function() {
request({ request({
url: '/api/v1/authentication/user-session/', url: '/api/v1/authentication/user-session/',
method: 'get' method: 'get',
disableFlashErrorMsg: true
}) })
})() })()
@ -105,6 +106,7 @@ window.addEventListener('beforeunload', (event) => {
IdBeforeunload = true IdBeforeunload = true
request({ request({
url: '/api/v1/authentication/user-session/', url: '/api/v1/authentication/user-session/',
method: 'delete' method: 'delete',
disableFlashErrorMsg: true
}) })
}) })

View File

@ -1,11 +1,12 @@
<template> <template>
<div class="chat-container"> <div class="chat-container">
<ChatAi ref="chat" :drawer-panel-visible="true" :has-close="false" /> <ChatAi ref="chat" :drawer-panel-visible="true" />
</div> </div>
</template> </template>
<script> <script>
import ChatAi from '@/components/Apps/ChatAi' import ChatAi from '@/components/Apps/ChatAi'
export default { export default {
components: { components: {
ChatAi ChatAi
@ -15,7 +16,6 @@ export default {
} }
}, },
mounted() { mounted() {
this.$refs.chat.initWebSocket()
}, },
methods: { methods: {
} }

View File

@ -47,16 +47,16 @@ module.exports = {
// change xxx-api/login => mock/login // change xxx-api/login => mock/login
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
'/api/': { '/api/': {
target: process.env.VUE_APP_CORE_HOST, target: process.env.VUE_APP_CORE_HOST || 'http://127.0.0.1:8080',
changeOrigin: true changeOrigin: true
}, },
'/ws/': { '/ws/': {
target: process.env.VUE_APP_CORE_WS, target: process.env.VUE_APP_CORE_WS || 'ws://1237.0.0.1:8080',
changeOrigin: true, changeOrigin: true,
ws: true ws: true
}, },
'/koko/': { '/koko/': {
target: process.env.VUE_APP_KOKO_HOST, target: process.env.VUE_APP_KOKO_HOST || 'http://127.0.0.1:5000',
changeOrigin: true, changeOrigin: true,
ws: true ws: true
}, },
@ -75,7 +75,7 @@ module.exports = {
changeOrigin: true changeOrigin: true
}, },
'^/(core|static|media)/': { '^/(core|static|media)/': {
target: process.env.VUE_APP_CORE_HOST, target: process.env.VUE_APP_CORE_HOST || 'http://127.0.0.1:8080',
changeOrigin: true changeOrigin: true
} }
}, },