ec-admin/src/api/login-log.ts
liuyun 0a1fbf3df2 refactor: 前端时间类型 string → number(对齐 Unix 毫秒契约)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 16:54:19 +08:00

28 lines
767 B
TypeScript

import { http } from '@/api/http'
import type { PageResult } from '@/types/crud'
export interface LoginLog {
id: string
tenantCode: string
username: string | null
ip: string | null
userAgent: string | null
status: string
message: string | null
createdAt: number
}
export interface LoginLogQuery {
page: number
pageSize: number
username?: string
status?: string
}
export function listLoginLogs(query: LoginLogQuery, signal?: AbortSignal): Promise<PageResult<LoginLog>> {
const params: Record<string, unknown> = { page: query.page, pageSize: query.pageSize }
if (query.username) params.username = query.username
if (query.status) params.status = query.status
return http.get<PageResult<LoginLog>>('/login-logs', { params, signal })
}