From 2a61cb2d89a1944b84a0473c40c7be995a879b13 Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 17 Mar 2022 18:57:25 +0800 Subject: [PATCH] update: import intl --- app/config/rules.ts | 14 +++++++------- app/pages/Login/index.tsx | 6 +++--- .../Create/CommonCreate/PropertiesForm.tsx | 5 ++--- .../SchemaConfig/Create/CommonCreate/index.tsx | 2 +- .../SchemaConfig/Create/IndexCreate/index.tsx | 2 +- .../SchemaConfig/Edit/CommonEdit/PropertiesRow.tsx | 4 ++-- app/pages/Schema/SpaceCreate/index.tsx | 8 ++++---- 7 files changed, 20 insertions(+), 21 deletions(-) diff --git a/app/config/rules.ts b/app/config/rules.ts index 771310b2..baa83422 100644 --- a/app/config/rules.ts +++ b/app/config/rules.ts @@ -1,42 +1,42 @@ import { POSITIVE_INTEGER_REGEX } from '@app/utils/constant'; +import intl from 'react-intl-universal'; -export const hostRulesFn = intl => [ +export const hostRulesFn = () => [ { required: true, message: intl.get('formRules.hostRequired'), }, ]; -export const usernameRulesFn = intl => [ +export const usernameRulesFn = () => [ { required: true, message: intl.get('formRules.usernameRequired'), }, ]; -export const passwordRulesFn = intl => [ +export const passwordRulesFn = () => [ { required: true, message: intl.get('formRules.passwordRequired'), }, ]; - -export const nameRulesFn = intl => [ +export const nameRulesFn = () => [ { required: true, message: intl.get('formRules.nameRequired'), }, ]; -export const numberRulesFn = intl => [ +export const numberRulesFn = () => [ { pattern: POSITIVE_INTEGER_REGEX, message: intl.get('formRules.numberRequired'), }, ]; -export const replicaRulesFn = (intl, activeMachineNum) => [ +export const replicaRulesFn = (activeMachineNum) => [ { pattern: POSITIVE_INTEGER_REGEX, message: intl.get('formRules.numberRequired'), diff --git a/app/pages/Login/index.tsx b/app/pages/Login/index.tsx index 7fafc10e..a6d97bd2 100644 --- a/app/pages/Login/index.tsx +++ b/app/pages/Login/index.tsx @@ -49,13 +49,13 @@ const LoginPage: React.FC = () => { {intl.get('configServer.title')} - + - + - +