// let url = window.location.href
// history.replaceState('myorder','',this.removeURLParameter(url,'state'))
removeURLParameter(url, parameter) {
var urlparts = url.split('?');
if(urlparts.length >= 2) {
//参数名前缀
var prefix = encodeURIComponent(parameter) + '=';
var pars = urlparts[1].split(/[&;]/g);
//循环查找匹配参数
for(var i = pars.length; i-- > 0;) {
if(pars[i].lastIndexOf(prefix, 0) !== -1) {
//存在则删除
pars.splice(i, 1);
}
}
return urlparts[0] + (pars.length > 0 ? '?' + pars.join('&') : '');
}
return url;
},