From 1f51650c25c63ff8d3d46d4849c2470174893cdb Mon Sep 17 00:00:00 2001 From: WaterMan Date: Mon, 12 Aug 2019 11:30:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(h5):=20request=E7=9A=84get=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E6=95=B0=E6=8D=AE=E4=B8=BA=E5=A4=8D=E6=9D=82=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E4=B8=8D=E8=83=BD=E6=AD=A3=E7=A1=AE=E5=8F=91=E9=80=81?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-h5/src/api/utils/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) {