合并代码
This commit is contained in:
+11
-11
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user