添加截取url是否带参数的判断

This commit is contained in:
xuwenbo
2020-09-14 10:44:03 +08:00
parent 79930429d8
commit bd82399ff1

View File

@ -681,14 +681,15 @@ export function handleQrCode() {
export function handleUrlParam(path) {
console.log(path)
var theRequest = new Object();
if(path.includes("?")){
var url = path.split("?")[1]; //获取url中"?"符后的字串
console.log(url)
var theRequest = new Object();
let strs = url.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}