From 14fc1975b15ba14197b31d84593e06849881fb53 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Wed, 3 Jun 2020 15:18:58 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81message=20=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/form.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/store/form.ts b/src/store/form.ts index aaf630df..2b2ed1cc 100644 --- a/src/store/form.ts +++ b/src/store/form.ts @@ -328,10 +328,8 @@ export const FormStore = ServiceStore.named('FormStore') let valid = yield validate(hooks); if (!valid) { - (getRoot(self) as IRendererStore).notify( - 'error', - failedMessage || self.__('表单验证失败,请仔细检查') - ); + const msg = failedMessage ?? self.__('表单验证失败,请仔细检查'); + msg && (getRoot(self) as IRendererStore).notify('error', msg); throw new Error(self.__('验证失败')); }