diff --git a/.env.development b/.env.development index a3ff90d..6d906ff 100644 --- a/.env.development +++ b/.env.development @@ -38,4 +38,4 @@ VITE_COPILOT_HOST = 'https://test.gitcode.net/child/aichat-app/' VITE_BASE_URL=/ # AI大模型接口地址 -VITE_AI_API_HOST = ''http://222.20.126.208:8089' +VITE_AI_API_HOST = 'http://222.20.126.208:8089' diff --git a/.env.loc b/.env.loc index 09fd3ed..157cf15 100644 --- a/.env.loc +++ b/.env.loc @@ -40,4 +40,4 @@ VITE_COPILOT_HOST = 'https://local.gitcode.net:8003/child/aichat-app' VITE_BASE_URL=/openRepoPortal/ # AI大模型接口地址 -VITE_AI_API_HOST = ''http://222.20.126.208:8089' +VITE_AI_API_HOST = 'http://222.20.126.208:8089' diff --git a/.env.pre b/.env.pre index cbefc44..c71d494 100644 --- a/.env.pre +++ b/.env.pre @@ -40,4 +40,4 @@ VITE_COPILOT_HOST = 'https://pre-copilot-app.gitcode.com' VITE_BASE_URL=/openRepoPortal/ # AI大模型接口地址 -VITE_AI_API_HOST = ''http://222.20.126.208:8089' +VITE_AI_API_HOST = 'http://222.20.126.208:8089' diff --git a/.env.production b/.env.production index 6727555..172a2a7 100644 --- a/.env.production +++ b/.env.production @@ -40,4 +40,4 @@ VITE_COPILOT_HOST = 'https://copilot-app.gitcode.com' VITE_BASE_URL=/openRepoPortal/ # AI大模型接口地址 -VITE_AI_API_HOST = ''http://222.20.126.208:8089' +VITE_AI_API_HOST = 'http://222.20.126.208:8089' diff --git a/src/views/Jyh/AI/Home/index.vue b/src/views/Jyh/AI/Home/index.vue index 6cf2a02..fcf185e 100644 --- a/src/views/Jyh/AI/Home/index.vue +++ b/src/views/Jyh/AI/Home/index.vue @@ -145,13 +145,11 @@ import WarningList from './components/WarningList.vue'; import OssDetail from './components/OssDetail.vue'; import Other from './components/Other.vue'; import AIList from './components/AIList.vue'; -import { getChat } from '@/api/jyh'; import axios from 'axios'; import { useDiscussGetUserInfo } from '@/api/discussion/hook'; // 获取当前用户信息 & 是否登录 const { isLogin = false, userInfo = {}} = useDiscussGetUserInfo(); -debugger const inputValue = ref(''); const startChat = ref(false); @@ -214,6 +212,7 @@ const onSubmit = (e, answer = undefined) => { getAIAnswer(e,1); }; +const VITE_AI_API_HOST = (import.meta as any).env.VITE_AI_API_HOST; const getAIAnswer = async (content) => { messages.value.push({ from: 'ai-model', @@ -224,8 +223,7 @@ const getAIAnswer = async (content) => { loading: true, }); - const {data} = await axios.get('http://222.20.126.208:8089/api/v0/chat_use_sql?question='+content); - debugger + const {data} = await axios.get(VITE_AI_API_HOST + '/api/v0/chat_use_sql?question='+content); const {text,type} = data; if(type==='text') {