mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-12-16 07:10:34 +08:00
feat: 新增登录日志页面
This commit is contained in:
@@ -59,3 +59,58 @@ export const deleteOperationLogApi = (data: Array<number>) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 登录日志查询类 */
|
||||
export interface LoginLogQuery extends BasePageQuery {
|
||||
beginTime?: string;
|
||||
endTime?: string;
|
||||
ipAddress?: string;
|
||||
status?: string;
|
||||
username?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录日志信息
|
||||
*/
|
||||
export interface LoginLogsDTO {
|
||||
browser?: string;
|
||||
infoId?: string;
|
||||
ipAddress?: string;
|
||||
loginLocation?: string;
|
||||
loginTime?: Date;
|
||||
msg?: string;
|
||||
operationSystem?: string;
|
||||
/** TODO 这个登录状态的设计很奇怪 需要重构掉 */
|
||||
status?: number;
|
||||
statusStr?: string;
|
||||
username?: string;
|
||||
}
|
||||
|
||||
/** 获取操作日志列表 */
|
||||
export const getLoginLogListApi = (params?: LoginLogQuery) => {
|
||||
return http.request<ResponseData<PageDTO<LoginLogsDTO>>>(
|
||||
"get",
|
||||
"/logs/loginLogs",
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
export const exportLoginLogExcelApi = (
|
||||
params: LoginLogQuery,
|
||||
fileName: string
|
||||
) => {
|
||||
return http.download("/logs/loginLogs/excel", fileName, {
|
||||
params
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteLoginLogApi = (data: Array<number>) => {
|
||||
return http.request<ResponseData<void>>("delete", "/logs/loginLogs", {
|
||||
params: {
|
||||
// 需要将数组转换为字符串 否则Axios会将参数变成 noticeIds[0]:1 noticeIds[1]:2 这种格式,后端接收参数不成功
|
||||
ids: data.toString()
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user