Skip to content

Commit

Permalink
fix: 修复uni.request在content-type为urlencoded时传入非Object的data时参数处理不正确的Bug #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Wangyaqi committed Jan 8, 2020
1 parent 4454da5 commit 454d3c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platforms/app-plus/service/api/network/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function createRequestTaskById (requestTaskId, {
hasContentType = true
headers['Content-Type'] = header[name]
// TODO 需要重构
if (method === 'POST' && header[name].indexOf('application/x-www-form-urlencoded') === 0) {
if (method !== 'GET' && header[name].indexOf('application/x-www-form-urlencoded') === 0 && typeof data !== 'string' && !(data instanceof ArrayBuffer)) {
let bodyArray = []
for (let key in data) {
if (data.hasOwnProperty(key)) {
Expand Down

0 comments on commit 454d3c7

Please sign in to comment.