nantai-erp-admin/mock/utils.js

15 lines
277 B
JavaScript
Raw Permalink Normal View History

2024-09-23 10:51:42 +08:00
export function param2Obj(url) {
const search = url.split('?')[1]
if (!search) {
return {}
}
return JSON.parse(
'{"' +
decodeURIComponent(search)
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"') +
'"}'
)
}