feat: 添加请求参数验证中间件和设计令牌Hook

feat(validation): 为机房、机柜和设备路由添加Joi验证中间件

feat(hooks): 创建useDesignTokens Hook集中管理主题配置

feat(models): 为耗材模型添加乐观锁version字段和updatedAt索引

feat(3d): 增强3D场景和设备模型视觉效果与交互

refactor: 移除数据备份相关功能并优化代码结构

fix: 修复前端安全日志和密码加密工具

chore: 更新依赖并添加axios和joi库

docs: 更新注释和文档说明

style: 改进代码格式和命名一致性
This commit is contained in:
zhang1106
2026-01-29 16:53:29 +08:00
parent 6d61d6e54c
commit 9e6a3da888
23 changed files with 1518 additions and 1858 deletions
+13 -2
View File
@@ -15,9 +15,20 @@ api.interceptors.request.use(
const token = localStorage.getItem('token');
if (token) {
config.headers.Authorization = `Bearer ${token}`;
} else {
console.log('[API] No token found in localStorage');
}
// 开发环境下安全日志:过滤敏感字段
if (process.env.NODE_ENV === 'development') {
const sensitiveFields = ['password', 'oldPassword', 'newPassword', 'confirmPassword'];
const safeData = config.data ? { ...config.data } : null;
if (safeData) {
sensitiveFields.forEach(field => {
if (safeData[field]) safeData[field] = '***';
});
}
console.log(`[API] ${config.method?.toUpperCase()} ${config.url}`, safeData || '');
}
return config;
},
(error) => {