From 0598f3a09def3bf3d1dd6e7076c929c631df7fcc Mon Sep 17 00:00:00 2001 From: h_mo <596417202@qq.com> Date: Thu, 30 Mar 2023 08:22:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E7=94=9F=E4=BA=A7=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=AD=E6=8E=92=E9=99=A4=20mock=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/http/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/http/index.ts b/src/utils/http/index.ts index 61149b9..ecee418 100644 --- a/src/utils/http/index.ts +++ b/src/utils/http/index.ts @@ -1,6 +1,6 @@ import { createAlova } from 'alova'; import AdapterUniapp from '@alova/adapter-uniapp'; -import { getBaseUrl } from '@/utils/env'; +import { getBaseUrl, isDevMode } from '@/utils/env'; import { mockAdapter } from '@/mock'; import { assign } from 'lodash-es'; import { useAuthStore } from '@/state/modules/auth'; @@ -24,7 +24,7 @@ const HEADER = { const alovaInstance = createAlova({ baseURL: BASE_URL, ...AdapterUniapp({ - mockRequest: mockAdapter, + mockRequest: isDevMode() ? mockAdapter : undefined, }), timeout: 5000, beforeRequest: (method) => {