From 3389e64bbf2ea26fdb3c3e4de0fcb8b38b00bffb Mon Sep 17 00:00:00 2001 From: vbenAdmin Date: Tue, 9 Mar 2021 00:39:48 +0800 Subject: [PATCH] chore: release v2.2.2 --- src/createMockServer.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/createMockServer.ts b/src/createMockServer.ts index 2ad084b..73ce158 100644 --- a/src/createMockServer.ts +++ b/src/createMockServer.ts @@ -72,9 +72,8 @@ export async function requestMiddle(opt: ViteMockOptions) { const urlMatch = match(url, { decode: decodeURIComponent }); let query = queryParams.query; - - if (reqUrl) { - query = (urlMatch(reqUrl) as any).params; + if (reqUrl && JSON.stringify(query) == '{}') { + query = (urlMatch(reqUrl) as any).params || {}; } const body = (await parseJson(req)) as Record;