get请求多参数循环拼接
作者:互联网
filterParams = {
businessId: '',
deptId: '',
activityName: '',
seekerUserName: '',
accountSet: '',
publishName: '',
settlementTimeStart: '',
settlementTimeEnd: '',
activityTimeStart: '',
activityTimeEnd: '',
payStatus:'', //结算状态
isReimbursement:null,
onlyThisDept: '',
is_reimbursement:this.btnAuth('is_reimbursement')
}
// const strArr = Object.keys(obj).reduce((strArr: string[], cur: any) => {
// strArr.push(`${cur}=${(obj as any)[cur]}`);
// return strArr;
// }, []);
const param = Object.entries(this.filterParams)
.map((item: any) => `${item[0]}=${item[1]}`)
.join("&");
window.location.href=config.SERVER_URL+'lwjob/bill/userSettlement/exportSubsiby?'+param
标签:const,cur,get,strArr,param,item,拼接,any,请求 来源: https://www.cnblogs.com/xinheng/p/15076333.html