You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
890 B
32 lines
890 B
import request from '@/utils/request';
|
|
import type { ApiResult, PageResult } from '@/api/index';
|
|
import type { LoginRecord, LoginRecordParam } from './model';
|
|
import {SERVER_API_URL} from "@/utils/server";
|
|
|
|
/**
|
|
* 分页查询登录日志
|
|
*/
|
|
export async function pageLoginRecords(params: LoginRecordParam) {
|
|
const res = await request.get<ApiResult<PageResult<LoginRecord>>>(
|
|
SERVER_API_URL + '/system/login-record/page',
|
|
{ params }
|
|
);
|
|
if (res.code === 0) {
|
|
return res.data;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|
|
|
|
/**
|
|
* 查询登录日志列表
|
|
*/
|
|
export async function listLoginRecords(params?: LoginRecordParam) {
|
|
const res = await request.get<ApiResult<LoginRecord[]>>(
|
|
SERVER_API_URL + '/system/login-record',
|
|
{ params }
|
|
);
|
|
if (res.code === 0 && res.data) {
|
|
return res.data;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|