1const queryString = window.location.search;
2const urlParams = new URLSearchParams(queryString);
3const code = urlParams.get('code')
1var getParams = function (url) {
2 var params = {};
3 var parser = document.createElement('a');
4 parser.href = url;
5 var query = parser.search.substring(1);
6 var vars = query.split('&');
7 for (var i = 0; i < vars.length; i++) {
8 var pair = vars[i].split('=');
9 params[pair[0]] = decodeURIComponent(pair[1]);
10 }
11 return params;
12};