perf[chore]: add mock.js to instead of easy-mock (#281)
This commit is contained in:
14
mock/utils.js
Normal file
14
mock/utils.js
Normal file
@@ -0,0 +1,14 @@
|
||||
export function param2Obj(url) {
|
||||
const search = url.split('?')[1]
|
||||
if (!search) {
|
||||
return {}
|
||||
}
|
||||
return JSON.parse(
|
||||
'{"' +
|
||||
decodeURIComponent(search)
|
||||
.replace(/"/g, '\\"')
|
||||
.replace(/&/g, '","')
|
||||
.replace(/=/g, '":"') +
|
||||
'"}'
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user