Skip to content

Commit

Permalink
fix(h5): request的get请求数据为复杂结构不能正确发送的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanQuan authored and Littly committed Aug 12, 2019
1 parent c071797 commit 1f51650
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/taro-h5/src/api/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ function serializeParams (params) {
return ''
}
return Object.keys(params)
.map(key => (`${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)).join('&')
.map(key => (
`${encodeURIComponent(key)}=${typeof (params[key]) ==="object" ?
encodeURIComponent(JSON.stringify(params[key])):
encodeURIComponent(params[key])}`))
.join('&')
}

function temporarilyNotSupport (apiName) {
Expand Down

0 comments on commit 1f51650

Please sign in to comment.