import { Button, Checkbox, Divider, Input, Space } from 'antd'; import { loginModuleRecord } from '@/constants/app'; import { useInitAuth } from '@/features/auth/auth'; import { SubmitEnterButton, useFormRules } from '@/features/form'; type AccountKey = 'admin' | 'super' | 'user'; interface Account { key: AccountKey; label: string; password: string; userName: string; } type LoginParams = Pick; const INITIAL_VALUES = { password: '123456', userName: 'Soybean' }; const PwdLogin = () => { const { t } = useTranslation(); const { loading, toLogin } = useInitAuth(); const [form] = AForm.useForm(); const navigate = useNavigate(); const { formRules: { pwd, userName: userNameRules } } = useFormRules(); const accounts: Account[] = [ { key: 'super', label: t('page.login.pwdLogin.superAdmin'), password: '123456', userName: 'Super' }, { key: 'admin', label: t('page.login.pwdLogin.admin'), password: '123456', userName: 'Admin' }, { key: 'user', label: t('page.login.pwdLogin.user'), password: '123456', userName: 'User' } ]; async function handleSubmit() { const params = await form.validateFields(); toLogin(params); } function handleAccountLogin(account: Account) { toLogin(account); } function goCodeLogin() { navigate('code-login'); } function goRegister() { navigate('register'); } function goResetPwd() { navigate('reset-pwd'); } return ( <>

{t('page.login.pwdLogin.title')}

{t('page.login.pwdLogin.rememberMe')}
{t('common.confirm')}
{t('page.login.pwdLogin.otherAccountLogin')}
{accounts.map(item => { return ( ); })}
); }; export const handle = { constant: true, i18nKey: 'route.(blank)_login', title: 'login' }; export default PwdLogin;