12345678let url = 'https://baidu.com?a=1&b=12&c=info'let getUrlParams = function (URL) { let url = URL.split('?')[1] let urlsearchparam = new URLSearchParams(url) const params = Object.fromEntries(urlsearchparam.entries()) return params}console.log(getUrlParams(url))