Update index.js

This commit is contained in:
卜木 2017-07-03 11:21:31 +08:00 committed by 花裤衩
parent 56a048865d
commit 4fa07aea09
1 changed files with 3 additions and 4 deletions

View File

@ -110,11 +110,10 @@
export function param2Obj(url) { export function param2Obj(url) {
const search = url.split('?')[1]; const search = url.split('?')[1];
if (search !== undefined) { if (!search) {
return JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}'); return {}
} }
return {}; return JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}');
} }
export function html2Text(val) { export function html2Text(val) {