fix: 去除已经实现过了的接口的假数据相关逻辑
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
* 操作日志 API
|
||||
*/
|
||||
import { get } from '@/utils/request';
|
||||
import { USE_MOCK, MOCK_DELAY } from '@/config/mock';
|
||||
import { buildMockOperationLogPage } from '@/config/mock/operationLogs';
|
||||
import type {
|
||||
OperationLogQueryParams,
|
||||
SysOperationLogVO,
|
||||
@@ -20,27 +18,10 @@ export type {
|
||||
ApiResult,
|
||||
} from './types';
|
||||
|
||||
const delay = (ms: number) => new Promise<void>((r) => setTimeout(r, ms));
|
||||
|
||||
function pickFilters(params: OperationLogQueryParams): OperationLogQueryParams {
|
||||
const { page: _page, limit: _limit, ...filters } = params;
|
||||
return filters;
|
||||
}
|
||||
|
||||
/** GET /admin/sys/operation/page — 系统操作日志分页 */
|
||||
export async function getOperationLogList(
|
||||
params: OperationLogQueryParams,
|
||||
): Promise<ApiResult<PageData<SysOperationLogVO>>> {
|
||||
if (USE_MOCK) {
|
||||
await delay(MOCK_DELAY);
|
||||
const page = Number(params.page) || 1;
|
||||
const limit = Number(params.limit) || 10;
|
||||
return {
|
||||
code: 200,
|
||||
msg: 'success',
|
||||
data: buildMockOperationLogPage(page, limit, pickFilters(params)),
|
||||
};
|
||||
}
|
||||
return get('/sys/operation/page', params as Record<string, any>);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user