const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const id = urlParams.get('id'); console.log(id); // 根据实际URL参数返回值不同