fix: 去除已经实现过了的接口的假数据相关逻辑

This commit is contained in:
ZhuRui
2026-08-06 09:02:49 +08:00
parent e542d7bdf3
commit e3bd35e154
29 changed files with 0 additions and 2258 deletions
-19
View File
@@ -3,38 +3,19 @@
* 对应 OpenAPI: GET /admin/finance/withdraw/page, GET /admin/finance/withdraw/info
*/
import { get, post } from '@/utils/request';
import { USE_MOCK, MOCK_DELAY } from '@/config/mock';
import { buildMockWithdrawPage } from '@/config/mock/withdrawList';
import { buildMockWithdrawInfo } from '@/config/mock/withdrawInfo';
import type { WithdrawQueryParams, WithdrawVO, WithdrawInfoVO, PageData, ApiResult } from './types';
export type { WithdrawVO, WithdrawInfoVO, WithdrawQueryParams, PageData, ApiResult } from './types';
const delay = (ms: number) => new Promise<void>((r) => setTimeout(r, ms));
/** GET /admin/finance/withdraw/page — 提现列表分页 */
export async function getWithdrawList(
params: WithdrawQueryParams,
): Promise<ApiResult<PageData<WithdrawVO>>> {
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: buildMockWithdrawPage(page, limit, params),
};
}
return get('/admin/finance/withdraw/page', params as Record<string, any>);
}
/** GET /admin/finance/withdraw/info?id=xxx — 提现详情 */
export async function getWithdrawInfo(id: number): Promise<ApiResult<WithdrawInfoVO>> {
if (USE_MOCK) {
await delay(MOCK_DELAY);
return { code: 200, msg: 'success', data: buildMockWithdrawInfo(id) };
}
return get('/admin/finance/withdraw/info', { id: String(id) });
}