Commit 4fa07aea authored by 卜木's avatar 卜木 Committed by 花裤衩

Update index.js

parent 56a04886
......@@ -110,11 +110,10 @@
export function param2Obj(url) {
const search = url.split('?')[1];
if (search !== undefined) {
return JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}');
if (!search) {
return {}
}
return {};
return JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}');
}
export function html2Text(val) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment