feat: add Logs
This commit is contained in:
@@ -13,6 +13,10 @@ import type {
|
||||
PagedResult,
|
||||
UserRoleDetail,
|
||||
User,
|
||||
ActionLog,
|
||||
LoginLog,
|
||||
ActionLogFilters,
|
||||
LoginLogFilters,
|
||||
} from '../types'
|
||||
|
||||
export async function login(username: string, password: string): Promise<LoginResponse> {
|
||||
@@ -221,3 +225,13 @@ export async function getUserPermissions(userId: string): Promise<MenuItem[]> {
|
||||
const { data } = await api.get<MenuItem[]>(`/api/users/${userId}/permissions`)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function getActionLogs(params: ActionLogFilters = {}): Promise<PagedResult<ActionLog>> {
|
||||
const { data } = await api.get<PagedResult<ActionLog>>('/api/audit/actions', { params })
|
||||
return data
|
||||
}
|
||||
|
||||
export async function getLoginLogs(params: LoginLogFilters = {}): Promise<PagedResult<LoginLog>> {
|
||||
const { data } = await api.get<PagedResult<LoginLog>>('/api/audit/logins', { params })
|
||||
return data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user