用自己封装的axios发送post请求, 后台返回400. 说我参数格式错误export const questionnaire = (payload) => { return request(C.QUESTIONNAIRE,'post',payload,{ transformRequest: [function (data, headers) { headers['Content-Type'] = 'application/x-www-form-urlencoded' data = qs.stringify(data) return data }] })}点击按钮发送请求handleClick(index, row) { this.idx = index this.loading = true (this.pidList为数组数据) questionnaire({params: this.pidList}).then( result => { this.loading = false console.log(result) }) },后台数据格式:
添加回答
举报
0/150
提交
取消