let arr = []; function keyName(key, name) { return name ? `${name}[key]` : key; } const serialize = (obj, name) => { for (let key in obj) { if (obj[key] === undefined) continue; switch (Object.prototype.toString.call(obj[key])) { case "[object Object]": serialize(ob...
importrequestfrom"@/utils/request"; importqsfrom"qs"; exportfunctiongetXXX(params) { returnrequest({ url:"/api/xxx/xxx", method:"get", params, paramsSerializer:(params) =>{ returnqs.stringify(params, {indices:false}); }, }); } 其它选项: qs.stringify({ a: ['b','c','d'] }, {...
第二个参数,query参数之间的链接符号,默认是 & querystring.stringify({name:'cg',course:['jade','node'],from:'zh'},'$') //运行结果 'name=cg$course=jade$course=node$from=zh' 1. 2. 3. 第三个参数,key和value之间的符号,默认是 = querystring.stringify({name:'dyh',course:['jade','node...