wwf
3 天以前 a430284aa21e3ae1f0d5654e55b2ad2852519cc2
app/forgot-password/ForgotPasswordForm.tsx
@@ -10,14 +10,13 @@
import Loading from '../components/base/loading'
import Input from '../components/base/input'
import Button from '@/app/components/base/button'
import { WEB_PREFIX } from '@/config'
import {
  fetchInitValidateStatus,
  fetchSetupStatus,
  sendForgotPasswordEmail,
} from '@/service/common'
import type { InitValidateStatusResponse } from '@/models/common'
import type { InitValidateStatusResponse, SetupStatusResponse } from '@/models/common'
const accountFormSchema = z.object({
  email: z
@@ -68,10 +67,10 @@
  }
  useEffect(() => {
    fetchSetupStatus().then(() => {
    fetchSetupStatus().then((res: SetupStatusResponse) => {
      fetchInitValidateStatus().then((res: InitValidateStatusResponse) => {
        if (res.status === 'not_started')
          window.location.href = `${WEB_PREFIX}/init`
          window.location.href = '/init'
      })
      setLoading(false)
@@ -83,20 +82,20 @@
      ? <Loading />
      : <>
        <div className="sm:mx-auto sm:w-full sm:max-w-md">
          <h2 className="text-[32px] font-bold text-text-primary">
          <h2 className="text-[32px] font-bold text-gray-900">
            {isEmailSent ? t('login.resetLinkSent') : t('login.forgotPassword')}
          </h2>
          <p className='mt-1 text-sm text-text-secondary'>
          <p className='mt-1 text-sm text-gray-600'>
            {isEmailSent ? t('login.checkEmailForResetLink') : t('login.forgotPasswordDesc')}
          </p>
        </div>
        <div className="mt-8 grow sm:mx-auto sm:w-full sm:max-w-md">
          <div className="relative">
        <div className="grow mt-8 sm:mx-auto sm:w-full sm:max-w-md">
          <div className="bg-white ">
            <form>
              {!isEmailSent && (
                <div className='mb-5'>
                  <label htmlFor="email"
                    className="my-2 flex items-center justify-between text-sm font-medium text-text-primary">
                    className="my-2 flex items-center justify-between text-sm font-medium text-gray-900">
                    {t('login.email')}
                  </label>
                  <div className="mt-1">
@@ -104,7 +103,7 @@
                      {...register('email')}
                      placeholder={t('login.emailPlaceholder') || ''}
                    />
                    {errors.email && <span className='text-sm text-red-400'>{t(`${errors.email?.message}`)}</span>}
                    {errors.email && <span className='text-red-400 text-sm'>{t(`${errors.email?.message}`)}</span>}
                  </div>
                </div>
              )}