first commit

This commit is contained in:
zc
2026-02-26 17:31:18 +08:00
commit f1b87df6ca
803 changed files with 297148 additions and 0 deletions

View File

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

26
src/apis/monitor/log.ts Normal file
View File

@@ -0,0 +1,26 @@
import type * as T from './type'
import http from '@/utils/http'
export type * from './type'
const BASE_URL = '/system/log'
/** @desc 查询日志列表 */
export function listLog(query: T.LogPageQuery) {
return http.get<PageRes<T.LogResp[]>>(`${BASE_URL}`, query)
}
/** @desc 查询日志详情 */
export function getLog(id: string) {
return http.get<T.LogDetailResp>(`${BASE_URL}/${id}`)
}
/** @desc 导出登录日志 */
export function exportLoginLog(query: T.LogQuery) {
return http.download<any>(`${BASE_URL}/export/login`, query)
}
/** @desc 导出操作日志 */
export function exportOperationLog(query: T.LogQuery) {
return http.download<any>(`${BASE_URL}/export/operation`, query)
}

View File

@@ -0,0 +1,16 @@
import type * as T from './type'
import http from '@/utils/http'
export type * from './type'
const BASE_URL = '/monitor/online'
/** @desc 查询在线用户列表 */
export function listOnlineUser(query: T.OnlineUserPageQuery) {
return http.get<PageRes<T.OnlineUserResp[]>>(`${BASE_URL}`, query)
}
/** @desc 强退在线用户 */
export function kickout(token: string) {
return http.del(`${BASE_URL}/${token}`)
}

57
src/apis/monitor/type.ts Normal file
View File

@@ -0,0 +1,57 @@
/** 在线用户类型 */
export interface OnlineUserResp {
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 OnlineUserQuery {
nickname?: string
loginTime?: string
sort: Array<string>
}
export interface OnlineUserPageQuery extends OnlineUserQuery, PageQuery {}
/** 系统日志类型 */
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: Array<string>
status?: number
sort: Array<string>
}
export interface LogPageQuery extends LogQuery, PageQuery {}