28 lines
767 B
TypeScript
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 })
|
|
}
|