|
@@ -30,6 +30,44 @@ axiosInstance.interceptors.request.use(
|
|
|
return Promise.reject(error);
|
|
|
}
|
|
|
);
|
|
|
+// 请求拦截器
|
|
|
+axiosInstance.interceptors.request.use(
|
|
|
+ (config) => {
|
|
|
+ console.log('【网络】🚀 请求:', {
|
|
|
+ url: config.url,
|
|
|
+ method: config.method,
|
|
|
+ headers: config.headers,
|
|
|
+ data: config.data,
|
|
|
+ params: config.params,
|
|
|
+ });
|
|
|
+ return config;
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ console.error('【网络】❌ 请求错误:', error);
|
|
|
+ return Promise.reject(error);
|
|
|
+ }
|
|
|
+);
|
|
|
+
|
|
|
+// 响应拦截器
|
|
|
+axiosInstance.interceptors.response.use(
|
|
|
+ (response) => {
|
|
|
+ console.log('【网络】✅ 响应:', {
|
|
|
+ url: response.config.url,
|
|
|
+ status: response.status,
|
|
|
+ data: response.data,
|
|
|
+ });
|
|
|
+ return response;
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ console.error('【网络】❌ 响应错误:', {
|
|
|
+ url: error.config?.url,
|
|
|
+ status: error.response?.status,
|
|
|
+ message: error.message,
|
|
|
+ data: error.response?.data,
|
|
|
+ });
|
|
|
+ return Promise.reject(error);
|
|
|
+ }
|
|
|
+);
|
|
|
|
|
|
axiosInstance.interceptors.response.use(
|
|
|
(response) => {
|