getUrlArgs(){
let qs = location.search.length > 0 ? location.search.substring(1) : "",
args = {},
items = qs.length ? qs.split("&") : [],
item = null,
name = null,
value = null,
i = 0,
len = items.length;
for(i;i<len;i++){
item = items[i].split("=");
name = decodeURIComponent(item[0]);//解码
value = decodeURIComponent(item[1]);
args[name] = value;
}
return args;
}
网友评论