refactor(security): 重构安全配置并优化测试环境

- 移除旧的测试套件和UAT测试文件
- 更新密码编码器配置使用BCrypt strength=12
- 添加用户角色关联表和相关服务
- 优化前端日期显示格式
- 清理无用资源和配置文件
- 增强测试数据管理和清理功能
This commit is contained in:
张翔
2026-03-27 13:00:22 +08:00
parent ce30893a96
commit af44c23f21
294 changed files with 16057 additions and 22601 deletions
@@ -191,17 +191,17 @@ const systemInfo = reactive({
const fetchStats = async () => {
loading.value = true
try {
const userCountRes: any = await request.get('/users/count')
stats.userCount = userCountRes || 0
const [userCountRes, roleCountRes, todayLoginRes, operationLogRes] = await Promise.allSettled([
request.get('/users/count'),
request.get('/roles/count'),
request.get('/logs/login/today/count'),
request.get('/logs/operation/count')
])
const roleCountRes: any = await request.get('/roles/count')
stats.roleCount = roleCountRes || 0
const todayLoginRes: any = await request.get('/logs/login/today/count')
stats.todayLogin = todayLoginRes || 0
const operationLogRes: any = await request.get('/logs/operation/count')
stats.operationLog = operationLogRes || 0
stats.userCount = userCountRes.status === 'fulfilled' ? (userCountRes.value || 0) : 0
stats.roleCount = roleCountRes.status === 'fulfilled' ? (roleCountRes.value || 0) : 0
stats.todayLogin = todayLoginRes.status === 'fulfilled' ? (todayLoginRes.value || 0) : 0
stats.operationLog = operationLogRes.status === 'fulfilled' ? (operationLogRes.value || 0) : 0
} catch (error) {
console.error('Failed to fetch stats:', error)
} finally {
@@ -210,14 +210,12 @@ const fetchStats = async () => {
}
const fetchRecentLogins = async () => {
loading.value = true
try {
const res: any = await request.get('/logs/login/recent?limit=10')
recentLogins.value = res || []
} catch (error) {
console.error('Failed to fetch recent logins:', error)
} finally {
loading.value = false
recentLogins.value = []
}
}