From a7667cbe28b6675250d832a3a7be85e0e2047fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E6=B0=91=E5=BA=B7?= Date: Tue, 13 May 2025 18:06:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E4=BF=A1=E4=BB=A3=E7=A0=81=E5=BA=93-A?= =?UTF-8?q?I=E5=A4=A7=E6=A8=A1=E5=9E=8B=E6=89=B9=E9=87=8F=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E6=8E=A5=E5=8F=A3=E5=AF=B9=E8=AF=9D=E5=8F=8A=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.loc | 2 +- .env.pre | 2 +- .env.production | 2 +- src/views/Jyh/AI/Home/index.vue | 6 ++---- 5 files changed, 6 insertions(+), 8 deletions(-) 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') {