|
@@ -9,8 +9,8 @@ import 'nprogress/nprogress.css'
|
|
|
|
|
|
// 创建一个 Axios 实例
|
|
|
const http: AxiosInstance = axios.create({
|
|
|
- // baseURL: window.origin, // 替换为你的 API 基础 URL
|
|
|
- baseURL: 'http://127.0.0.1:3000', // 替换为你的 API 基础 URL
|
|
|
+ baseURL: window.origin, // 替换为你的 API 基础 URL
|
|
|
+ // baseURL: 'http://127.0.0.1:3000', // 替换为你的 API 基础 URL
|
|
|
timeout: 10000, // 请求超时时间
|
|
|
headers: {
|
|
|
'Content-Type': 'application/json'
|
|
@@ -38,10 +38,10 @@ http.interceptors.request.use(
|
|
|
// 响应拦截器
|
|
|
http.interceptors.response.use(
|
|
|
(response) => {
|
|
|
-
|
|
|
+
|
|
|
// 响应成功关闭进度条
|
|
|
nProgress.done()
|
|
|
-
|
|
|
+
|
|
|
// 对响应数据做点什么
|
|
|
return response
|
|
|
},
|