Commit aa4ad5b5 authored by 邓超's avatar 邓超

fix: 修改用户验证

parent aaaa4a1e
Pipeline #55143 passed with stages
......@@ -124,26 +124,26 @@ const AddUserModal = props => {
rules={[
{
pattern: /^[a-zA-Z0-9_]{0,}$/,
message: '不支持中文和特殊字符',
message: '长度小于16位,支持字母与数字,允许下划线',
},
{ required: true },
]}
>
<Input placeholder="登录名称不支持中文与特殊字符" maxLength="20" />
<Input placeholder="请输入登录名称(小于16位)" maxLength="16" />
</Form.Item>
<Form.Item
hasFeedback
name="password"
label="账密码"
label="账密码"
rules={[
{
pattern: /^(?=.*[a-zA-Z\d])(?=.*([a-zA-Z].*))(?=.*[0-9].*)[!-~]{6,16}$/,
message: '密码长度6-16位,且必须包含数字和字母,不能存在空格',
pattern: /^[a-zA-Z0-9_]{6,16}$/,
message: '长度6-16位,支持字母与数字,允许下划线',
},
{ required: true },
]}
>
<Input placeholder="请输入账户密码,至少6位" maxlength="16" />
<Input placeholder="请输入账号密码(6~16位)" maxlength="16" />
</Form.Item>
<Form.Item
hasFeedback
......@@ -151,10 +151,13 @@ const AddUserModal = props => {
label="用户姓名"
rules={[
{ required: true },
{ pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/, message: '不支持特殊字符' },
{
pattern: /^[A-Za-z0-9_\u4e00-\u9fa5]+$/,
message: '长度小于16位,支持字母、中文与数字,允许下划线',
},
]}
>
<Input placeholder="用户姓名不支持特殊字符" maxLength="20" />
<Input placeholder="请输入用户姓名(小于16位)" maxLength="16" />
</Form.Item>
<Form.Item
hasFeedback
......@@ -164,11 +167,11 @@ const AddUserModal = props => {
{ required: true },
{
pattern: new RegExp(/^1[0-9]{10}$/),
message: '手机号码以1开头11位',
message: '请输入正确的手机号码!',
},
]}
>
<Input placeholder="请输入11位手机号码" maxlength="11" autoComplete="off" />
<Input placeholder="请输入手机号码" maxlength="11" autoComplete="off" />
</Form.Item>
<Form.Item
hasFeedback
......@@ -177,7 +180,7 @@ const AddUserModal = props => {
rules={[
{
type: 'email',
message: '请输入正确的电子邮箱!',
message: '请输入正确的电子邮箱',
},
]}
>
......
......@@ -119,8 +119,8 @@ const ChangePasswordModal = props => {
label="新密码"
rules={[
{
pattern: /^(?=.*[a-zA-Z\d])(?=.*([a-zA-Z].*))(?=.*[0-9].*)[!-~]{6,16}$/,
message: '密码长度6-16位,且必须包含数字和字母,不能存在空格',
pattern: /^[a-zA-Z0-9_]{6,16}$/,
message: '长度6-16位,支持字母与数字,允许下划线',
},
{ required: true },
]}
......@@ -132,8 +132,8 @@ const ChangePasswordModal = props => {
label="确认密码"
rules={[
{
pattern: /^(?=.*[a-zA-Z\d])(?=.*([a-zA-Z].*))(?=.*[0-9].*)[!-~]{6,16}$/,
message: '密码长度6-16位,且必须包含数字和字母,不能存在空格',
pattern: /^[a-zA-Z0-9_]{6,16}$/,
message: '长度6-16位,支持字母与数字,允许下划线',
},
{ required: true },
]}
......
......@@ -133,12 +133,12 @@ const EditUserModal = props => {
rules={[
{
pattern: /^[a-zA-Z0-9_]{0,}$/,
message: '不支持中文和特殊字符',
message: '长度小于16位,支持字母与数字,允许下划线',
},
{ required: true },
]}
>
<Input placeholder="登录名称不支持中文与特殊字符" maxLength="20" />
<Input placeholder="请输入登录名称(小于16位)" maxLength="16" />
</Form.Item>
<Form.Item
hasFeedback
......@@ -146,10 +146,13 @@ const EditUserModal = props => {
label="用户姓名"
rules={[
{ required: true },
{ pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/, message: '不支持特殊字符' },
{
pattern: /^[A-Za-z0-9_\u4e00-\u9fa5]+$/,
message: '长度小于16位,支持字母、中文与数字,允许下划线',
},
]}
>
<Input placeholder="用户姓名不支持特殊字符" maxLength="20" />
<Input placeholder="请输入用户姓名(小于16位)" maxLength="16" />
</Form.Item>
<Form.Item
hasFeedback
......@@ -159,11 +162,11 @@ const EditUserModal = props => {
{ required: true },
{
pattern: new RegExp(/^1[0-9]{10}$/),
message: '手机号码以1开头11位',
message: '请输入正确的手机号码!',
},
]}
>
<Input placeholder="请输入11位手机号码" autoComplete="off" maxlength="11" />
<Input placeholder="请输入手机号码" autoComplete="off" maxlength="11" />
</Form.Item>
<Form.Item
hasFeedback
......@@ -172,7 +175,7 @@ const EditUserModal = props => {
rules={[
{
type: 'email',
message: '请输入正确的电子邮箱!',
message: '请输入正确的电子邮箱',
},
]}
>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment