提交 3830228d 编写于 作者: Q qiang

fix: 修复uni.request在content-type为urlencoded时传入非Object的data时参数处理不正确的Bug #1218

上级 ea32f40f
......@@ -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)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册