This commit is contained in:
jxxghp
2023-06-30 17:09:47 +08:00
parent dab2fa4a13
commit 24df541392
3 changed files with 3 additions and 1 deletions

1
.env.development Normal file
View File

@@ -0,0 +1 @@
VITE_API_BASE_URL=http://localhost:3001/api/v1/

1
.env.production Normal file
View File

@@ -0,0 +1 @@
VITE_API_BASE_URL=/api/v1/

View File

@@ -4,7 +4,7 @@ import axios from 'axios'
// 创建axios实例
const api = axios.create({
baseURL: '/api/v1/',
baseURL: import.meta.env.VITE_API_BASE_URL,
})
// 添加请求拦截器