var param = { "regionCodes": "110000,120000,13000", "purchaseGroups": "A01,A02", "feedBackType": "0", "isReplied": "0", "bTime": "20170301", "eTime": "20170431", "page": 0, "size": 20 }原来是post方法直接传参就行,现在先用get方法 所以要把参数拼接在url后面,类似形式:https://segmentfault.com/ask?regionCodes=110000,120000,13000&purchaseGroups=A01,A02&feedBackType='0'...写了一个函数但是对于不能满足要求(处理不了逗号)function changeParam(param){ return JSON.stringify(param).replace(/:/g,'=').replace(/,/g,'&').replace(/{/g,'?').replace(/}/g,'').replace(/"/g,''); }求一个函数完美转换的函数
添加回答
举报
0/150
提交
取消
