处理函数
export function parseUrl(paramName: string):string {
let url = window.location.search;
let hashUrl = window.location.hash;
if (!url&&!hashUrl) {
window.console.error('url错误');
return '';
}
if (url.indexOf('?') === 0) {
url = url.slice(1);
} else {
url = hashUrl.split('?')[1];
}
if(url) {
return JSON.parse(`{"${decodeURI(url.replace(/&/g, '\%22,\%22').replace(/=/g, '\%22:\%22'))}"}`)[paramName];
} else {
return '';
}
}