地址栏模板动态赋值
export const getUrl = function(jumpurl,list)
{
let search = jumpurl.split("?");
let pairs=search[1].split("&");
let argname = '';
let url = ''
for(var i=0;i<pairs.length;i++){
var pos=pairs[i].indexOf('=');
if(pos==-1) continue;
argname = pairs[i].substring(0,pos);
url += argname + "=" + (list[argname] === undefined ? GetQueryString(argname,search[1]) : list[argname]) + (i < pairs.length-1 ? "&" : "");
}
return (search[0] + "?" + url);
}
function GetQueryString(name,search)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = search.match(reg);
if(r!=null)return unescape(r[2]); return null;
}