mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-11-10 02:57:12 +08:00
refactor: 系统管理/系统日志 => 系统监控/系统日志
This commit is contained in:
@@ -1 +1,2 @@
|
||||
export * from './online'
|
||||
export * from './log'
|
||||
|
||||
24
src/apis/monitor/log.ts
Normal file
24
src/apis/monitor/log.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import http from '@/utils/http'
|
||||
import type * as Monitor from './type'
|
||||
|
||||
const BASE_URL = '/system/log'
|
||||
|
||||
/** @desc 查询日志列表 */
|
||||
export function listLog(query: Monitor.LogPageQuery) {
|
||||
return http.get<PageRes<Monitor.LogResp[]>>(`${BASE_URL}`, query)
|
||||
}
|
||||
|
||||
/** @desc 查询日志详情 */
|
||||
export function getLog(id: string) {
|
||||
return http.get<Monitor.LogDetailResp>(`${BASE_URL}/${id}`)
|
||||
}
|
||||
|
||||
/** @desc 导出登录日志 */
|
||||
export function exportLoginLog(query: Monitor.LogQuery) {
|
||||
return http.download<any>(`${BASE_URL}/export/login`, query)
|
||||
}
|
||||
|
||||
/** @desc 导出操作日志 */
|
||||
export function exportOperationLog(query: Monitor.LogQuery) {
|
||||
return http.download<any>(`${BASE_URL}/export/operation`, query)
|
||||
}
|
||||
@@ -13,8 +13,43 @@ export interface OnlineUserResp {
|
||||
createUserString: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
export interface OnlineUserQuery extends PageQuery {
|
||||
nickname?: string
|
||||
loginTime?: string
|
||||
}
|
||||
|
||||
/** 系统日志类型 */
|
||||
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{
|
||||
description?: string
|
||||
module?: string
|
||||
ip?: string
|
||||
createUserString?: string
|
||||
createTime?: string
|
||||
status?: number
|
||||
sort: Array<string>
|
||||
}
|
||||
export interface LogPageQuery extends PageQuery, LogQuery {}
|
||||
|
||||
@@ -2,7 +2,7 @@ export * from './user'
|
||||
export * from './role'
|
||||
export * from './menu'
|
||||
export * from './dept'
|
||||
export * from './log'
|
||||
export * from '../monitor/log'
|
||||
export * from './dict'
|
||||
export * from './file'
|
||||
export * from './storage'
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import http from '@/utils/http'
|
||||
import type * as System from './type'
|
||||
|
||||
const BASE_URL = '/system/log'
|
||||
|
||||
/** @desc 查询日志列表 */
|
||||
export function listLog(query: System.PageLogQuery) {
|
||||
return http.get<PageRes<System.LogResp[]>>(`${BASE_URL}`, query)
|
||||
}
|
||||
|
||||
/** @desc 查询日志详情 */
|
||||
export function getLog(id: string) {
|
||||
return http.get<System.LogDetailResp>(`${BASE_URL}/${id}`)
|
||||
}
|
||||
/** @desc 导出日志列表 */
|
||||
export function exportLog(query: System.LogQuery) {
|
||||
return http.download<any>(`${BASE_URL}/export/login`, query)
|
||||
}
|
||||
/**@desc 导出操作日志 */
|
||||
export function exportOperateLog(query: System.LogQuery) {
|
||||
return http.download<any>(`${BASE_URL}/export/operation`, query)
|
||||
}
|
||||
@@ -119,43 +119,6 @@ export interface DeptQuery {
|
||||
sort: Array<string>
|
||||
}
|
||||
|
||||
/** 系统日志类型 */
|
||||
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 PageLogQuery extends PageQuery,LogQuery{}
|
||||
// 系统日志查询条件
|
||||
export interface LogQuery{
|
||||
description?: string
|
||||
module?: string
|
||||
ip?: string
|
||||
createUserString?: string
|
||||
createTime?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
/** 系统字典类型 */
|
||||
export interface DictResp {
|
||||
id: string
|
||||
|
||||
Reference in New Issue
Block a user