基于 URLSearchParams 获取当URL参数
1 function urlGet() 2 { 3 var urlSearchParams = new URLSearchParams(window.location.search); 4 var params = Object.fromEntries(urlSearchParams.entries()); 5 6 return params; 7 }