Skip to content

Commit

Permalink
chore: release v2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vben-admin committed Mar 8, 2021
1 parent 134d881 commit 4474a2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-plugin-mock",
"version": "2.2.1",
"version": "2.2.2",
"description": "A mock plugin for vite",
"main": "dist/index.js",
"files": [
Expand Down
5 changes: 2 additions & 3 deletions src/createMockServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>;
Expand Down

0 comments on commit 4474a2e

Please sign in to comment.