From 3a38adc71e00be6abb6645bcaf2687eb992b64ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BC=A0=E9=BE=99?= Date: Sat, 3 Sep 2022 22:43:57 +0800 Subject: [PATCH] fix: mock api error --- mock/api/post.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/mock/api/post.js b/mock/api/post.js index 579c533..d869f7e 100644 --- a/mock/api/post.js +++ b/mock/api/post.js @@ -122,16 +122,12 @@ export default [ url: '/api/post/:id', method: 'delete', response: ({ query }) => { - if (!query.id) { - return { code: -1, message: '删除失败,id不能为空' } - } else { - return { - code: 0, - message: 'ok', - data: { - id: query.id, - }, - } + return { + code: 0, + message: 'ok', + data: { + id: query.id, + }, } }, },