let url = 'https://i-beta.cnblogs.com/posts/edit?param1=123¶m2=second' let arr = url.split('&');
let obj = new Object();
for (var i = 0; i < arr.length; i++) {
obj[arr[i].split('=')[0]] = arr[i].split('=')[1];
}
执行后这里的obj = {param:'123', param2:'second'}