验证message 可以关闭

This commit is contained in:
2betop 2020-06-03 15:18:58 +08:00
parent a893133922
commit 14fc1975b1
1 changed files with 2 additions and 4 deletions

View File

@ -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.__('验证失败'));
}