Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
26e56baa
Commit
26e56baa
authored
Mar 08, 2022
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改新增用户密码正则
parent
129171c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
32 deletions
+38
-32
AddUserModal.jsx
src/pages/userCenter/userManage/AddUserModal.jsx
+38
-32
No files found.
src/pages/userCenter/userManage/AddUserModal.jsx
View file @
26e56baa
...
...
@@ -15,7 +15,7 @@ const AddUserModal = props => {
useEffect
(()
=>
{
addUserForm
.
resetFields
();
console
.
log
(
orgID
)
console
.
log
(
orgID
)
;
},
[
orgID
]);
// 提交-添加用户
...
...
@@ -36,17 +36,17 @@ const AddUserModal = props => {
message
:
'提交失败'
,
description
:
'登录名不支持中文!'
,
});
}
else
if
(
password
===
''
)
{
}
else
if
(
password
===
''
)
{
notification
.
error
({
message
:
'提交失败'
,
description
:
'密码不能为空!'
,
});
}
else
if
(
password
.
length
<
6
)
{
}
else
if
(
password
.
length
<
6
)
{
notification
.
error
({
message
:
'提交失败'
,
description
:
'密码至少为6位,且包含数字和字母!'
,
});
}
else
if
(
userName
===
''
)
{
}
else
if
(
userName
===
''
)
{
notification
.
error
({
message
:
'提交失败'
,
description
:
'用户名称不能为空!'
,
...
...
@@ -72,7 +72,7 @@ const AddUserModal = props => {
)
{
addUser
({
OUID
:
orgID
.
id
,
loginName
,
userName
,
password
,
phone
,
email
})
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
addUserForm
.
resetFields
();
onCancel
();
// 设置Modal不可见
notification
.
success
({
...
...
@@ -103,52 +103,58 @@ const AddUserModal = props => {
cancelText=
"取消"
>
<
Form
form=
{
addUserForm
}
labelCol=
{
{
span
:
4
}
}
>
<
span
style=
{
{
position
:
'absolute'
,
top
:
'21%'
,
color
:
'red'
,
fontSize
:
'16px'
}
}
>
*
</
span
>
<
span
style=
{
{
position
:
'absolute'
,
top
:
'21%'
,
color
:
'red'
,
fontSize
:
'16px'
}
}
>
*
</
span
>
<
Form
.
Item
hasFeedback
hasFeedback
name=
"loginName"
label=
"登录名称"
rules=
{
[{
pattern
:
new
RegExp
(
/^
[^\u
4e00-
\u
9fa5
]
+$/
),
message
:
'不支持中文'
},
{
pattern
:
new
RegExp
(
/^
[^\s]
*$/
),
message
:
'不能为空'
}
rules=
{
[
{
pattern
:
new
RegExp
(
/^
[^\u
4e00-
\u
9fa5
]
+$/
),
message
:
'不支持中文'
,
},
{
pattern
:
new
RegExp
(
/^
[^\s]
*$/
),
message
:
'不能为空'
,
},
]
}
>
<
Input
placeholder=
"登录名称不支持中文"
/>
</
Form
.
Item
>
<
span
style=
{
{
position
:
'absolute'
,
top
:
'35%'
,
color
:
'red'
,
fontSize
:
'16px'
}
}
>
*
</
span
>
<
span
style=
{
{
position
:
'absolute'
,
top
:
'35%'
,
color
:
'red'
,
fontSize
:
'16px'
}
}
>
*
</
span
>
<
Form
.
Item
hasFeedback
hasFeedback
name=
"password"
label=
"账户密码"
rules=
{
[
{
pattern
:
/^
[^\s]
*$/
,
message
:
'不能为空'
}
,
{
pattern
:
/^
(?![
0-9
]
+$
)(?![
a-zA-Z
]
+$
)[
0-9A-Za-z
]
{6,}$/
,
message
:
'密码长度必须大于6,且必须包含数字和字母'
}
]
}
rules=
{
[
{
pattern
:
/^
[^\s]
*$/
,
message
:
'不能为空'
,
},
{
pattern
:
/
(?=
.*
([
a-zA-Z
]
.*
))(?=
.*
[
0-9
]
.*
)[
a-zA-Z0-9-*
/
+.~!@#$%^&*()
]
{6,20}$/
,
message
:
'密码长度必须大于6,且必须包含数字和字母'
,
},
]
}
>
<
Input
placeholder=
"请输入账户密码,至少6位"
/>
</
Form
.
Item
>
<
span
style=
{
{
position
:
'absolute'
,
top
:
'49%'
,
color
:
'red'
,
fontSize
:
'16px'
}
}
>
*
</
span
>
<
span
style=
{
{
position
:
'absolute'
,
top
:
'49%'
,
color
:
'red'
,
fontSize
:
'16px'
}
}
>
*
</
span
>
<
Form
.
Item
hasFeedback
hasFeedback
name=
"userName"
label=
"用户名称"
rules=
{
[{
pattern
:
/^
[^\s]
*$/
,
message
:
'不能为空'
}]
}
rules=
{
[
{
pattern
:
/^
[^\s]
*$/
,
message
:
'不能为空'
,
},
]
}
>
<
Input
placeholder=
"请输入用户姓名"
/>
</
Form
.
Item
>
<
Form
.
Item
hasFeedback
hasFeedback
name=
"phone"
label=
"手机号码"
rules=
{
[
...
...
@@ -161,7 +167,7 @@ const AddUserModal = props => {
<
Input
placeholder=
"请输入11位手机号码"
autoComplete=
"off"
/>
</
Form
.
Item
>
<
Form
.
Item
hasFeedback
hasFeedback
name=
"email"
label=
"电子邮箱"
rules=
{
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment