fix(client): 设备移除逻辑与认证流程优化

- 修改设备移除时的本地清理方法,统一调用 clearLocalAuth
- 优化设备数量限制校验逻辑,避免重复计算当前设备- 移除冗余的设备状态检查,简化设备移除流程- 调整 Redis 连接超时与等待时间,提升连接稳定性- 增强 MySQL 数据库连接配置,添加自动重连机制
-优化 Druid 连接池参数,提高数据库连接性能
- 简化客户端认证与数据上报逻辑,提升处理效率
- 移除过期设备状态更新逻辑,减少不必要的数据库操作- 调整慢 SQL 记录阈值,便于及时发现性能问题-优化版本分布与数据类型统计查询逻辑,提高响应速度
This commit is contained in:
2025-10-15 18:32:48 +08:00
parent f614860eee
commit 6f04658265
29 changed files with 702 additions and 1010 deletions

View File

@@ -304,7 +304,7 @@ const SSEManager = {
console.log('SSE连接已就绪')
break
case 'DEVICE_REMOVED':
logout()
clearLocalAuth()
ElMessage.warning('您的设备已被移除,请重新登录')
break
case 'FORCE_LOGOUT':
@@ -390,7 +390,7 @@ async function confirmRemoveDevice(row: DeviceItem & { isCurrent?: boolean }) {
deviceQuota.value.used = Math.max(0, (deviceQuota.value.used || 0) - 1)
if (row.deviceId === getClientIdFromToken()) {
clearLocalAuth() // 移除当前设备只清理本地状态不调用offline避免覆盖removed状态
clearLocalAuth()
}
ElMessage.success('已移除设备')