perf: init db and config
This commit is contained in:
@@ -60,15 +60,10 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
|
||||
<form onSubmit={handleSubmit(onclickLogin)}>
|
||||
<FormControl mt={8} isInvalid={!!errors.username}>
|
||||
<Input
|
||||
placeholder="邮箱/手机号"
|
||||
placeholder="邮箱/手机号/用户名"
|
||||
size={['md', 'lg']}
|
||||
{...register('username', {
|
||||
required: '邮箱/手机号不能为空',
|
||||
pattern: {
|
||||
value:
|
||||
/(^1[3456789]\d{9}$)|(^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$)/,
|
||||
message: '邮箱/手机号格式错误'
|
||||
}
|
||||
required: '邮箱/手机号/用户名不能为空'
|
||||
})}
|
||||
></Input>
|
||||
<FormErrorMessage position={'absolute'} fontSize="xs">
|
||||
@@ -82,13 +77,9 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
|
||||
placeholder="密码"
|
||||
{...register('password', {
|
||||
required: '密码不能为空',
|
||||
minLength: {
|
||||
value: 4,
|
||||
message: '密码最少4位最多12位'
|
||||
},
|
||||
maxLength: {
|
||||
value: 12,
|
||||
message: '密码最少4位最多12位'
|
||||
message: '密码最多12位'
|
||||
}
|
||||
})}
|
||||
></Input>
|
||||
|
||||
Reference in New Issue
Block a user