From 6c50a0de48e5f688ff48ad7bbd5817da137c0ff9 Mon Sep 17 00:00:00 2001 From: 18369190717pan <270687594@qq.com> Date: Wed, 25 Dec 2019 15:52:28 +0800 Subject: [PATCH] =?UTF-8?q?[FIX]=20=E4=BF=AE=E5=A4=8D=20mip-form=20submitE?= =?UTF-8?q?rror=20=E4=BA=8B=E4=BB=B6=E6=B2=A1=E6=9C=89=E6=8A=9B=E5=87=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/mip-form/mip-form-fn.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/mip-form/mip-form-fn.js b/components/mip-form/mip-form-fn.js index b34b0a6b..249aeda0 100644 --- a/components/mip-form/mip-form-fn.js +++ b/components/mip-form/mip-form-fn.js @@ -199,8 +199,10 @@ export default class Form { } fetch(xhrUrl, fetchData).then((res) => { + let resData = null if (res.ok) { res.json().then((data) => { + resData = data this.triggerCustomEvent(FORM_EVENT.SUBMIT_SUCCESS, { response: data }) @@ -211,7 +213,9 @@ export default class Form { this.fetchReject(err) }) } else { - this.triggerCustomEvent(FORM_EVENT.SUBMIT_ERROR, {}) + this.triggerCustomEvent(FORM_EVENT.SUBMIT_ERROR, { + response: resData + }) this.fetchReject({}) } }).catch((err) => {