用自己封裝的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) }) },后臺數據格式:
axios封裝的post請求,后臺返回400問題
慕森王
2019-03-12 13:12:14