|
@@ -33,6 +33,10 @@ axiosInstance.interceptors.request.use(
|
|
|
// 请求拦截器
|
|
// 请求拦截器
|
|
|
axiosInstance.interceptors.request.use(
|
|
axiosInstance.interceptors.request.use(
|
|
|
(config) => {
|
|
(config) => {
|
|
|
|
|
+ if (config.url?.includes('/pub/quota')) {
|
|
|
|
|
+ // 不打印配额查询请求日志
|
|
|
|
|
+ return config;
|
|
|
|
|
+ }
|
|
|
console.log('【网络】🚀 请求:', {
|
|
console.log('【网络】🚀 请求:', {
|
|
|
url: config.url,
|
|
url: config.url,
|
|
|
method: config.method,
|
|
method: config.method,
|
|
@@ -58,11 +62,14 @@ axiosInstance.interceptors.response.use(
|
|
|
data: response.data,
|
|
data: response.data,
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- console.log('【网络】✅ 响应:', {
|
|
|
|
|
- url: response.config.url,
|
|
|
|
|
- status: response.status,
|
|
|
|
|
- data: response.data,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if (!response.config.url?.includes('/pub/quota')) {
|
|
|
|
|
+ // 非配额查询响应需要纪录日志
|
|
|
|
|
+ console.log('【网络】✅ 响应:', {
|
|
|
|
|
+ url: response.config.url,
|
|
|
|
|
+ status: response.status,
|
|
|
|
|
+ data: response.data,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
return response;
|
|
return response;
|
|
|
},
|
|
},
|
|
@@ -85,7 +92,7 @@ axiosInstance.interceptors.response.use(
|
|
|
if (error.response && error.response.data.code === 0x000101) {
|
|
if (error.response && error.response.data.code === 0x000101) {
|
|
|
emitter.emit('tokenExpired');
|
|
emitter.emit('tokenExpired');
|
|
|
// eslint-disable-next-line
|
|
// eslint-disable-next-line
|
|
|
- return new Promise(() => {}); // Suspend the current execution
|
|
|
|
|
|
|
+ return new Promise(() => { }); // Suspend the current execution
|
|
|
}
|
|
}
|
|
|
return Promise.reject(error);
|
|
return Promise.reject(error);
|
|
|
}
|
|
}
|