json2params(json, slice = '&') {
return Object.keys(json)
.reduce((acc, item) => {
return String(acc) + item + '=' + json[item] + slice;
}, '')
.slice(0, -1);
}
转载于:https://www.cnblogs.com/aisiqi-love/p/11394351.html