mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-29 18:29:44 +08:00
后端地址配置
This commit is contained in:
parent
ff8cecd780
commit
78c20e33b7
@ -78,6 +78,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
<script src="/config.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
2
views/public/config.js
Normal file
2
views/public/config.js
Normal file
@ -0,0 +1,2 @@
|
||||
window.baseApi = '/api'
|
||||
|
||||
@ -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',
|
||||
},
|
||||
|
||||
@ -41,7 +41,7 @@ function handleEnter({ uuid }: Chat.History, isEdit: boolean, event: KeyboardEve
|
||||
<NUpload
|
||||
multiple
|
||||
directory-dnd
|
||||
:action="`${web_url()}/api/local_doc_qa/upload_file`"
|
||||
:action="`${web_url()}/${window.baseApi}/local_doc_qa/upload_file`"
|
||||
:headers="{
|
||||
'naive-info': 'hello!',
|
||||
}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user