fix: 优化错误处理,减少控制台噪音

- axiosConfig: 忽略 CanceledError 错误日志(组件卸载时的正常行为)
- socketService: 首次连接失败使用 warn 级别,后续重试使用 debug 级别
- useEventData: 添加防御性检查,防止 pagination 为 undefined 时崩溃

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zdl
2025-12-18 18:03:10 +08:00
parent 2ce74b4331
commit a5bc1e1ce3
3 changed files with 27 additions and 10 deletions

View File

@@ -52,6 +52,11 @@ axios.interceptors.response.use(
return response;
},
(error) => {
// 忽略取消请求的错误(组件卸载时正常行为)
if (error.name === 'CanceledError' || axios.isCancel(error)) {
return Promise.reject(error);
}
const method = error.config?.method?.toUpperCase() || 'UNKNOWN';
const url = error.config?.url || 'UNKNOWN';
const requestData = error.config?.data || error.config?.params || null;