合并代码

This commit is contained in:
2025-11-25 20:50:34 +08:00
parent e01d8be5fa
commit 83f8d80e12
3 changed files with 160 additions and 125 deletions
+11 -11
View File
@@ -90,12 +90,12 @@ axiosInstance.interceptors.request.use(
const token = localStorage.getItem('access_token');
if (token) {
config.headers.Authorization = `Bearer ${token}`;
console.log('🔑 [Request Interceptor] 添加Authorization头:', {
url: config.url,
method: config.method,
hasToken: !!token,
tokenPreview: token.substring(0, 20) + '...'
});
// console.log('🔑 [Request Interceptor] 添加Authorization头:', {
// url: config.url,
// method: config.method,
// hasToken: !!token,
// tokenPreview: token.substring(0, 20) + '...'
// });
} else {
console.warn('⚠️ [Request Interceptor] 没有找到access_token:', {
url: config.url,
@@ -127,11 +127,11 @@ export class AuthenticationError extends Error {
*/
axiosInstance.interceptors.response.use(
(response) => {
console.log('✅ [Response Interceptor] 请求成功:', {
url: response.config.url,
status: response.status,
statusText: response.statusText
});
// console.log('✅ [Response Interceptor] 请求成功:', {
// url: response.config.url,
// status: response.status,
// statusText: response.statusText
// });
return response;
},
(error) => {