From bbac5c7ecfac642fa57eae9ebe420e1514d93449 Mon Sep 17 00:00:00 2001 From: Hooray Hu <304327508@qq.com> Date: Thu, 7 Mar 2024 09:22:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20mock=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=97=A0=E5=93=8D=E5=BA=94=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plop-templates/mock/mock.hbs | 42 ++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/plop-templates/mock/mock.hbs b/plop-templates/mock/mock.hbs index 0968320e..08ab6ff2 100755 --- a/plop-templates/mock/mock.hbs +++ b/plop-templates/mock/mock.hbs @@ -45,34 +45,40 @@ export default [ { url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/create', method: 'post', - response: { - error: '', - status: 1, - data: { - isSuccess: true, - }, + response: () => { + return { + error: '', + status: 1, + data: { + isSuccess: true, + }, + } }, }, { url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/edit', method: 'post', - response: { - error: '', - status: 1, - data: { - isSuccess: true, - }, + response: () => { + return { + error: '', + status: 1, + data: { + isSuccess: true, + }, + } }, }, { url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/delete', method: 'post', - response: { - error: '', - status: 1, - data: { - isSuccess: true, - }, + response: () => { + return { + error: '', + status: 1, + data: { + isSuccess: true, + }, + } }, }, ]