추가
This commit is contained in:
23
backend/api/auth/recent-users.get.ts
Normal file
23
backend/api/auth/recent-users.get.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { query } from '../../utils/db'
|
||||
|
||||
/**
|
||||
* 최근 로그인 사용자 목록
|
||||
* GET /api/auth/recent-users
|
||||
*/
|
||||
export default defineEventHandler(async () => {
|
||||
const users = await query(`
|
||||
SELECT * FROM wr_recent_login_users
|
||||
ORDER BY last_active_at DESC
|
||||
LIMIT 10
|
||||
`)
|
||||
|
||||
return {
|
||||
users: users.map((u: any) => ({
|
||||
employeeId: u.employee_id,
|
||||
employeeName: u.employee_name,
|
||||
employeeEmail: u.employee_email,
|
||||
employeePosition: u.employee_position,
|
||||
lastActiveAt: u.last_active_at
|
||||
}))
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user