From 78c20e33b7c8f472a755b46cb5fc81f74af8afe1 Mon Sep 17 00:00:00 2001 From: fxjhello <2395112364@qq.com> Date: Tue, 16 May 2023 10:08:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=AB=AF=E5=9C=B0=E5=9D=80=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/index.html | 1 + views/public/config.js | 2 ++ views/src/api/axios.ts | 6 +----- .../src/views/chat/layout/sider/knowledge-base/filelist.vue | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 views/public/config.js diff --git a/views/index.html b/views/index.html index 7954786..c3ec7d4 100644 --- a/views/index.html +++ b/views/index.html @@ -78,6 +78,7 @@ + diff --git a/views/public/config.js b/views/public/config.js new file mode 100644 index 0000000..fbe3522 --- /dev/null +++ b/views/public/config.js @@ -0,0 +1,2 @@ +window.baseApi = '/api' + diff --git a/views/src/api/axios.ts b/views/src/api/axios.ts index 9fefd54..e97c7de 100644 --- a/views/src/api/axios.ts +++ b/views/src/api/axios.ts @@ -5,11 +5,7 @@ import axios from 'axios' import { useMessage } from 'naive-ui' const instance = axios.create({ // process.env.NODE_ENV === 'development' 来判断是否开发环境 - baseURL: '/api', - /* process.env.USAGE === 'development' - ? - window.baseApi ?? '/api' - : 'http://192.168.1.99:51798', */ + baseURL: window.baseApi, headers: { 'Content-Type': 'application/json;charset=UTF-8', }, diff --git a/views/src/views/chat/layout/sider/knowledge-base/filelist.vue b/views/src/views/chat/layout/sider/knowledge-base/filelist.vue index 985b630..e58e23b 100644 --- a/views/src/views/chat/layout/sider/knowledge-base/filelist.vue +++ b/views/src/views/chat/layout/sider/knowledge-base/filelist.vue @@ -41,7 +41,7 @@ function handleEnter({ uuid }: Chat.History, isEdit: boolean, event: KeyboardEve