方法:
window.location.href = prefixURL+'webstatic/messageAnalysis/datadetail.html?id=' + num + "&time=" + time+"&authKey="+this.authKey
getUrlArgs: function () {
const query = location.search.substring(1);
const pairs = query.split('&');
let args = {};
let pos;
let idx;
let argname;
let val;

 

for (var i = 0; i < pairs.length; i++) {
pos = pairs[i];
idx = pos.indexOf('=');
if (idx == -1) continue;
argname = pos.substring(0, idx);
val = decodeURIComponent(pos.substring(idx + 1));
args[argname] = val;
}
return args;
},
 
方法调用:
获取url后面对应的参数名称
 
let urlArgs = globalFunc.getUrlArgs();
this.authKey = urlArgs.authKey;
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
猜你喜欢
  • 2022-01-07
  • 2022-03-08
  • 2021-07-28
  • 2022-12-23
  • 2021-05-16
  • 2021-12-16
相关资源
相似解决方案