diff --git a/packages/taro-h5/src/api/utils/index.js b/packages/taro-h5/src/api/utils/index.js index b3fe8827ef60..43e135bf3429 100644 --- a/packages/taro-h5/src/api/utils/index.js +++ b/packages/taro-h5/src/api/utils/index.js @@ -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) {