feat: 用户操作日志.

This commit is contained in:
lijiahang
2023-11-01 18:57:53 +08:00
parent cfcb5cb7a8
commit eafe69ebca
45 changed files with 1255 additions and 157 deletions

View File

@@ -1,5 +1,5 @@
import type { LoginHistoryQueryResponse } from './operator-log';
import type { UserQueryResponse, UserUpdateRequest } from './user';
import type { UserQueryResponse, UserSessionQueryResponse, UserSessionOfflineRequest, UserUpdateRequest } from './user';
import axios from 'axios';
/**
@@ -38,3 +38,16 @@ export function getCurrentLoginHistory() {
return axios.get<LoginHistoryQueryResponse[]>('/infra/mine/login-history');
}
/**
* 获取当前用户会话列表
*/
export function getCurrentUserSessionList() {
return axios.get<UserSessionQueryResponse[]>('/infra/mine/user-session');
}
/**
* 下线当前用户会话
*/
export function offlineCurrentUserSession(request: UserSessionOfflineRequest) {
return axios.put('/infra/mine/offline-session', request);
}

View File

@@ -30,6 +30,7 @@ export interface OperatorLogQueryResponse {
module: string;
type: string;
logInfo: string;
originLogInfo: string;
extra: string;
result: number;
errorMessage: string;

View File

@@ -40,10 +40,10 @@ export interface RoleQueryRequest extends Pagination {
* 角色查询响应
*/
export interface RoleQueryResponse extends TableData {
id?: number;
name?: string;
code?: string;
status?: number;
id: number;
name: string;
code: string;
status: number;
createTime: number;
updateTime: number;
creator: string;

View File

@@ -42,13 +42,13 @@ export interface UserQueryRequest extends Pagination {
* 用户查询响应
*/
export interface UserQueryResponse extends TableData {
id?: number;
username?: string;
nickname?: string;
avatar?: string;
mobile?: string;
email?: string;
status?: number;
id: number;
username: string;
nickname: string;
avatar: string;
mobile: string;
email: string;
status: number;
lastLoginTime?: number;
createTime: number;
updateTime: number;
@@ -56,6 +56,26 @@ export interface UserQueryResponse extends TableData {
updater: string;
}
/**
* 用户会话查询响应
*/
export interface UserSessionQueryResponse {
visible: boolean;
current: boolean;
address: string;
location: string;
userAgent: string;
loginTime: number;
}
/**
* 用户会话下线请求
*/
export interface UserSessionOfflineRequest {
userId?: number;
timestamp: number;
}
/**
* 创建用户
*/