Skip to content

Commit

Permalink
feat: 修改axios逻辑
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 29832
  • Loading branch information
jidanjuan committed Jan 23, 2025
1 parent e9a581e commit f990c91
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions bklog/web/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,8 @@ axiosInstance.interceptors.request.use(
* response interceptor
*/
axiosInstance.interceptors.response.use(
response => {
// 打印请求后的 traceparent
// const traceparent = response.config.headers.Traceparent;
// console.log('请求后的 traceparent:', response);

return response.data;
},
error => {
// 如果请求失败,打印traceparent
const traceparent = error.config && error.config.headers.Traceparent;
console.error('请求失败时的 traceparent:', traceparent);
return Promise.reject(error);
}
response => response.data,
error => Promise.reject(error),
);

const http = {
Expand Down

0 comments on commit f990c91

Please sign in to comment.