feat: 个人信息页面.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
|
||||
/**
|
||||
* 登陆请求
|
||||
* 登录请求
|
||||
*/
|
||||
export interface LoginRequest {
|
||||
username?: string;
|
||||
@@ -9,7 +9,7 @@ export interface LoginRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* 登陆响应
|
||||
* 登录响应
|
||||
*/
|
||||
export interface LoginResponse {
|
||||
token: string;
|
||||
@@ -24,7 +24,7 @@ export interface UserUpdatePasswordRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* 登陆
|
||||
* 登录
|
||||
*/
|
||||
export function login(data: LoginRequest) {
|
||||
return axios.post<LoginResponse>('/infra/auth/login', data);
|
||||
|
||||
75
orion-ops-ui/src/api/user/operator-log.ts
Normal file
75
orion-ops-ui/src/api/user/operator-log.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
import type { DataGrid, Pagination } from '@/types/global';
|
||||
import axios from 'axios';
|
||||
|
||||
/**
|
||||
* 操作日志查询参数
|
||||
*/
|
||||
export interface OperatorLogQueryRequest extends Pagination {
|
||||
userId?: number;
|
||||
username?: string;
|
||||
module?: string;
|
||||
type?: string;
|
||||
riskLevel?: string;
|
||||
result?: number;
|
||||
startTimeStart?: string;
|
||||
startTimeEnd?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作日志查询响应
|
||||
*/
|
||||
export interface OperatorLogQueryResponse {
|
||||
id: number;
|
||||
userId: number;
|
||||
username: string;
|
||||
traceId: string;
|
||||
address: string;
|
||||
location: string;
|
||||
userAgent: string;
|
||||
riskLevel: string;
|
||||
module: string;
|
||||
type: string;
|
||||
logInfo: string;
|
||||
extra: string;
|
||||
result: number;
|
||||
errorMessage: string;
|
||||
returnValue: string;
|
||||
duration: number;
|
||||
startTime: number;
|
||||
endTime: number;
|
||||
createTime: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录日志查询响应
|
||||
*/
|
||||
export interface LoginHistoryQueryResponse {
|
||||
id: number;
|
||||
address: string;
|
||||
location: string;
|
||||
userAgent: string;
|
||||
result: number;
|
||||
errorMessage: string;
|
||||
createTime: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页操作日志
|
||||
*/
|
||||
export function getOperatorLogPage(request: OperatorLogQueryRequest) {
|
||||
return axios.post<DataGrid<OperatorLogQueryResponse>>('/infra/operator-log/query', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询登录日志
|
||||
*/
|
||||
export function getLoginHistory(username: string) {
|
||||
return axios.get<LoginHistoryQueryResponse[]>('/infra/operator-log/login-history', { params: { username } });
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户登录日志
|
||||
*/
|
||||
export function getCurrentLoginHistory() {
|
||||
return axios.get<LoginHistoryQueryResponse[]>('/infra/operator-log/current-login-history');
|
||||
}
|
||||
@@ -12,8 +12,6 @@ export interface UserCreateRequest {
|
||||
avatar?: string;
|
||||
mobile?: string;
|
||||
email?: string;
|
||||
status?: number;
|
||||
lastLoginTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,6 +91,20 @@ export function resetUserPassword(request: UserUpdateRequest) {
|
||||
return axios.put('/infra/system-user/reset-password', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户
|
||||
*/
|
||||
export function getCurrentUser() {
|
||||
return axios.get<UserQueryResponse>('/infra/system-user/get-current');
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新当前用户
|
||||
*/
|
||||
export function updateCurrentUser(request: UserUpdateRequest) {
|
||||
return axios.put('/infra/system-user/update-current', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 id 查询用户
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user