提交 78c20e33 作者: fxjhello

后端地址配置

上级 ff8cecd7
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
</div> </div>
</div> </div>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
<script src="/config.js"></script>
</body> </body>
</html> </html>
window.baseApi = '/api'
...@@ -5,11 +5,7 @@ import axios from 'axios' ...@@ -5,11 +5,7 @@ import axios from 'axios'
import { useMessage } from 'naive-ui' import { useMessage } from 'naive-ui'
const instance = axios.create({ const instance = axios.create({
// process.env.NODE_ENV === 'development' 来判断是否开发环境 // process.env.NODE_ENV === 'development' 来判断是否开发环境
baseURL: '/api', baseURL: window.baseApi,
/* process.env.USAGE === 'development'
?
window.baseApi ?? '/api'
: 'http://192.168.1.99:51798', */
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',
}, },
......
...@@ -41,7 +41,7 @@ function handleEnter({ uuid }: Chat.History, isEdit: boolean, event: KeyboardEve ...@@ -41,7 +41,7 @@ function handleEnter({ uuid }: Chat.History, isEdit: boolean, event: KeyboardEve
<NUpload <NUpload
multiple multiple
directory-dnd directory-dnd
:action="`${web_url()}/api/local_doc_qa/upload_file`" :action="`${web_url()}/${window.baseApi}/local_doc_qa/upload_file`"
:headers="{ :headers="{
'naive-info': 'hello!', 'naive-info': 'hello!',
}" }"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论