From 0c9226a8ef737701f54ad903e523e53489ce53b7 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Thu, 29 Dec 2022 13:16:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=9C=A8=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E7=8E=AF=E5=A2=83=E5=90=AF=E7=94=A8=20mock=EF=BC=88?= =?UTF-8?q?=E5=8F=82=E8=80=83=EF=BC=9Aarco-design/arco-design-pro-vue#158?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- continew-admin-ui/src/utils/setup-mock.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/continew-admin-ui/src/utils/setup-mock.ts b/continew-admin-ui/src/utils/setup-mock.ts index 51b670b2..f341145c 100644 --- a/continew-admin-ui/src/utils/setup-mock.ts +++ b/continew-admin-ui/src/utils/setup-mock.ts @@ -1,7 +1,11 @@ -import debug from './env'; +// import debug from './env'; export default ({ mock, setup }: { mock?: boolean; setup: () => void }) => { - if (mock !== false && debug) setup(); + // 仅在开发环境启用 mock + // if (mock !== false && debug) setup(); + + // 在生产环境也启用 mock + if (mock !== false) setup(); }; export const successResponseWrap = (data: unknown) => { @@ -10,6 +14,7 @@ export const successResponseWrap = (data: unknown) => { success: true, code: 200, msg: '操作成功', + timestamp: new Date().toLocaleDateString().replace(/\//g, '-'), }; }; @@ -19,5 +24,6 @@ export const failResponseWrap = (data: unknown, msg: string, code = 500) => { success: false, code, msg, + timestamp: new Date().toLocaleDateString().replace(/\//g, '-'), }; };