提交 56a04886 编写于 作者: 卜木 提交者: 花裤衩

prevent JSON.parse fault when search is undefined

上级 ffd668fb
...@@ -110,7 +110,11 @@ ...@@ -110,7 +110,11 @@
export function param2Obj(url) { export function param2Obj(url) {
const search = url.split('?')[1]; const search = url.split('?')[1];
return JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}') if (search !== undefined) {
return JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}');
}
return {};
} }
export function html2Text(val) { export function html2Text(val) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册