From e360b0923028e6f405af8f8f44f74e5f1410fbf8 Mon Sep 17 00:00:00 2001 From: shuai Date: Tue, 7 Mar 2023 10:02:17 +0800 Subject: [PATCH] fix: unified email regular verification --- ui/src/pages/Install/components/FourthStep/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/pages/Install/components/FourthStep/index.tsx b/ui/src/pages/Install/components/FourthStep/index.tsx index 0f7d7b88..5ad77c9a 100644 --- a/ui/src/pages/Install/components/FourthStep/index.tsx +++ b/ui/src/pages/Install/components/FourthStep/index.tsx @@ -3,6 +3,7 @@ import { Form, Button } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; import type { FormDataType } from '@/common/interface'; +import Patern from '@/common/patern'; import Progress from '../Progress'; interface Props { @@ -54,8 +55,7 @@ const Index: FC = ({ visible, data, changeCallback, nextCallback }) => { }; } - const mailReg = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/; - if (contact_email.value && !contact_email.value.match(mailReg)) { + if (contact_email.value && !contact_email.value.match(Patern.mail)) { bol = false; data.contact_email = { value: contact_email.value, @@ -91,7 +91,7 @@ const Index: FC = ({ visible, data, changeCallback, nextCallback }) => { }; } - if (email.value && !email.value.match(mailReg)) { + if (email.value && !email.value.match(Patern.mail)) { bol = false; data.email = { value: email.value,