From e24cde1ba6a889ced25efdd44723b490b0b7f5e5 Mon Sep 17 00:00:00 2001 From: martsi Date: Fri, 19 Jul 2024 20:55:12 +0800 Subject: [PATCH] fix: mock api --- src/api/mock.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/api/mock.ts b/src/api/mock.ts index c649092..4c27263 100644 --- a/src/api/mock.ts +++ b/src/api/mock.ts @@ -4,15 +4,27 @@ * @Date: 2024/6/19 */ -import {MOCK_JOB, MOCK_TOOL} from "@/constant"; +import { MOCK_JOB, MOCK_TOOL } from "@/constant"; -export const fetchJob = (task: string) => +export const fetchSimpleJob = (task: string) => new Promise<{ data: any }>((resolve, _reject) => { MOCK_JOB.data.task = task; setTimeout( () => resolve({ - data: MOCK_JOB + data: MOCK_JOB, + }), + 1000, + ); + }); + +export const fetchLevelJob = (task: string) => + new Promise<{ data: any }>((resolve, _reject) => { + MOCK_JOB.data.task = task; + setTimeout( + () => + resolve({ + data: MOCK_JOB, }), 1000, );