浏览代码

no message

zhejiushizhuce 2 年之前
父节点
当前提交
a3b94cc99f
共有 1 个文件被更改,包括 27 次插入 和 0 次删除
  1. 27 0
      src/widgets/LoginForm/index.jsx

+ 27 - 0
src/widgets/LoginForm/index.jsx

@@ -164,6 +164,7 @@ const LoginForm = ({close}) => {
        }
     },[])
     useEffect(() => {
+        objInfo.inSubmit=false;
         if (hash===ROUTE_PATH.SIGN_IN){
             setShowType(TYPE_LOGIN);
         }
@@ -786,6 +787,32 @@ const LoginForm = ({close}) => {
                                     innerRef={ref}/>)
                             }}
                 />
+                <Controller control={control}
+                            name="password"
+                            rules={{required: true, minLength: 6}}
+                            render={({field: {ref, onChange, value}, fieldState: {error}}) => (
+                                <PasswordInput
+                                    className={classNames({'input-control--error': error})}
+                                    value={value}
+                                    message={error ? i18n.t("form_errors.pass") : ''}
+                                    onChange={e => onChange(e.target.value)}
+                                    placeholder={i18n.t('login.login_pwd')}
+                                    innerRef={ref}/>
+                            )}
+                />
+                <Controller control={control}
+                            name="repassword"
+                            rules={{required: true, minLength: 6}}
+                            render={({field: {ref, onChange, value}, fieldState: {error}}) => (
+                                <PasswordInput
+                                    className={classNames({'input-control--error': error})}
+                                    value={value}
+                                    message={error ? i18n.t("form_errors.pass") : ''}
+                                    onChange={e => onChange(e.target.value)}
+                                    placeholder={i18n.t('login.re_pwd')}
+                                    innerRef={ref}/>
+                            )}
+                />
                 <Controller control={control}
                             name="code"
                             rules={{required: true}}