直接上代码
function getQueryVariable() {
let query = window.location.search.substring(1);
let key_values = query.split("&");
let params = {};
key_values.map(key_val => {
let key_val_arr = key_val.split("=");
params[key_val_arr[0]] = key_val_arr[1];
});
return params;
}