function getUrlParam(sUrl, sKey) {
const urlAry = sUrl.split('?')[1].split('#')[0].split('&')
const obj = {}
urlAry.map(item => {
const keyValue = item.split('=')
if(obj[keyValue[0]]) {
if(Array.isArray(obj[keyValue[0]])) {
obj[keyValue[0]].push(keyValue[1])
}else {
obj[keyValue[0]] = [ obj[keyValue[0]], keyValue[1] ]
}
} else {
obj[keyValue[0]] = keyValue[1]
}
})
return sKey ? (obj[sKey] || '') : obj
}