feat: 初始化慧遇书院官网一期

This commit is contained in:
2026-08-12 18:01:17 +08:00
commit 5d31ee5743
101 changed files with 17259 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { requireAdmin } from '../../utils/auth'
import { useDatabase } from '../../utils/db'
export default defineEventHandler(async (event) => {
await requireAdmin(event)
const rows = useDatabase().prepare(`
SELECT audit_logs.id, audit_logs.action, audit_logs.entity_type, audit_logs.entity_key,
audit_logs.ip_address, audit_logs.created_at, admin_users.display_name
FROM audit_logs LEFT JOIN admin_users ON admin_users.id = audit_logs.operator_id
ORDER BY audit_logs.id DESC LIMIT 50
`).all() as Array<Record<string, string | number | null>>
return { data: rows.map(row => ({ id: row.id, action: row.action, entityType: row.entity_type, entityKey: row.entity_key, ipAddress: row.ip_address, createdAt: row.created_at, operator: row.display_name || '系统' })) }
})