diff --git a/packages/client/src/components/user/reset-password/index.tsx b/packages/client/src/components/user/reset-password/index.tsx index 7eeeeab4..f65f66fa 100644 --- a/packages/client/src/components/user/reset-password/index.tsx +++ b/packages/client/src/components/user/reset-password/index.tsx @@ -1,5 +1,5 @@ -import { Button, Col, Form, Row, Toast, Typography } from '@douyinfe/semi-ui'; -import { useResetPassword, useSystemPublicConfig, useVerifyCode } from 'data/user'; +import { Button, Col, Form, Row, Toast } from '@douyinfe/semi-ui'; +import { useResetPassword, useSystemPublicConfig, useUser, useVerifyCode } from 'data/user'; import { useInterval } from 'hooks/use-interval'; import { useToggle } from 'hooks/use-toggle'; import React, { useCallback, useState } from 'react'; @@ -8,6 +8,7 @@ export const ResetPassword = ({ onSuccess }) => { const [email, setEmail] = useState(''); const [hasSendVerifyCode, toggleHasSendVerifyCode] = useToggle(false); const [countDown, setCountDown] = useState(0); + const { user } = useUser(); const { reset, loading } = useResetPassword(); const { data: systemConfig } = useSystemPublicConfig(); const { sendVerifyCode, loading: sendVerifyCodeLoading } = useVerifyCode(); @@ -51,7 +52,11 @@ export const ResetPassword = ({ onSuccess }) => { }, [email, toggleHasSendVerifyCode, sendVerifyCode, start, stop]); return ( -
+ = ({ visible, toggleVisible }) => { const { user, loading, updateUser } = useUser(); const [currentAvatar, setCurrentAvatar] = useState(''); const [email, setEmail] = useState(''); + const { data: systemConfig } = useSystemPublicConfig(); const { sendVerifyCode, loading: sendVerifyCodeLoading } = useVerifyCode(); const [hasSendVerifyCode, toggleHasSendVerifyCode] = useToggle(false); const [countDown, setCountDown] = useState(0); @@ -108,7 +109,7 @@ export const UserSetting: React.FC = ({ visible, toggleVisible }) => { - {email && email !== user.email ? ( + {systemConfig && systemConfig.enableEmailVerify && email && email !== user.email ? (