feat: 新增系统日志管理(登录日志、操作日志)

This commit is contained in:
2024-04-09 21:34:56 +08:00
parent d0d1181c49
commit 20184c6e01
9 changed files with 487 additions and 3 deletions

View File

@@ -2,9 +2,11 @@ export * from './area'
export * from './auth'
export * from './common'
export * from './monitor'
export * from './system'
export * from './area/type'
export * from './auth/type'
export * from './common/type'
export * from './monitor/type'
export * from './system/type'

1
src/apis/system/index.ts Normal file
View File

@@ -0,0 +1 @@
export * from './log'

14
src/apis/system/log.ts Normal file
View File

@@ -0,0 +1,14 @@
import http from '@/utils/http'
import type * as System from './type'
const BASE_URL = '/system/log'
/** @desc 查询日志列表 */
export function listLog(query: System.LogQuery) {
return http.get<PageRes<System.LogResp[]>>(`${BASE_URL}`, query)
}
/** @desc 查询日志详情 */
export function getLog(id: string) {
return http.get<System.LogDetailResp>(`${BASE_URL}/${id}`)
}

33
src/apis/system/type.ts Normal file
View File

@@ -0,0 +1,33 @@
/** 系统日志类型 */
export interface LogResp {
id: string
description: string
module: string
timeTaken: number
ip: string
address: string
browser: string
os: string
status: number
errorMsg: string
createUserString: string
createTime: string
}
export interface LogDetailResp extends LogResp {
traceId: string
requestUrl: string
requestMethod: string
requestHeaders: string
requestBody: string
statusCode: number
responseHeaders: string
responseBody: string
}
export interface LogQuery extends PageQuery {
description?: string
module?: string
ip?: string
createUserString?: string
createTime?: string
status?: number
}