Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
980438d3
Commit
980438d3
authored
May 26, 2022
by
张子雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化
parent
1fdf38b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
14 deletions
+33
-14
index.jsx
src/pages/password/index.jsx
+32
-14
style.less
src/pages/password/style.less
+1
-0
No files found.
src/pages/password/index.jsx
View file @
980438d3
import
React
,
{
useRef
,
useState
}
from
'
react
'
;
import
{
Form
,
Input
,
Button
,
Checkbox
,
Card
,
notification
}
from
'
antd
'
;
import
{
Form
,
Input
,
Button
,
Checkbox
,
Card
,
notification
,
Popover
}
from
'
antd
'
;
import
{
history
}
from
'
umi
'
;
import
{
da
}
from
'
date-fns/locale
'
;
import
styles
from
'
./style.less
'
;
...
...
@@ -51,32 +51,51 @@ const Password = props => {
<
div
className=
{
styles
.
div
}
>
<
Card
className=
{
styles
.
card
}
>
<
p
>
修改密码
</
p
>
<
Form
initialValues=
{
{
remember
:
true
}
}
onFinish=
{
onFinish
}
autoComplete=
"off"
className=
{
styles
.
form
}
ref=
{
formRef
}
// labelCol={{
// span: 16,
// }}
// wrapperCol={{
// span: 16,
// }}
>
<
Form
.
Item
name=
"password"
rules=
{
[{
required
:
true
,
message
:
'
请输入原密码!
'
}]
}
>
<
Input
.
Password
placeholder=
"输入原密码"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"newPassword"
rules=
{
[
{
required
:
true
,
message
:
'
请输入新密码!
'
},
{
message
:
'
至少13最多18位且必须包含大小写字母、数字和特殊字符
'
,
pattern
:
/
(?=
.*
\d)(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
[^
a-zA-Z0-9
])
.{13,18}/
,
},
]
}
<
Popover
content=
"限13-18字符,包含大小写字母、数字和特殊字符"
placement=
"right"
trigger=
"hover"
>
<
Input
.
Password
placeholder=
"输入新密码"
maxLength=
{
18
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"newPassword"
validateFirst
rules=
{
[
{
required
:
true
,
message
:
'
请输入新密码!
'
},
{
min
:
13
,
message
:
'
密码最少13位
'
},
{
max
:
18
,
message
:
'
密码最多18位
'
},
{
message
:
'
至少13位且必须包含大小写字母、数字和特殊字符
'
,
pattern
:
/
(?=
.*
\d)(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
[^
a-zA-Z0-9
])
.{13,18}/
,
},
]
}
>
<
Input
.
Password
placeholder=
"输入新密码"
/>
</
Form
.
Item
>
</
Popover
>
<
Form
.
Item
name=
"newPasswordAgain"
validateFirst
rules=
{
[
{
required
:
true
,
message
:
'
请输入新密码!
'
},
{
min
:
13
,
message
:
'
密码最少13位
'
},
{
max
:
18
,
message
:
'
密码最多18位
'
},
{
message
:
'
至少13位最多18位且必须包含大小写字母、数字和特殊字符
'
,
pattern
:
/
(?=
.*
\d)(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
[^
a-zA-Z0-9
])
.{13,18}/
,
...
...
@@ -92,11 +111,10 @@ const Password = props => {
}),
]
}
>
<
Input
.
Password
placeholder=
"输入新密码"
maxLength=
{
18
}
/>
<
Input
.
Password
placeholder=
"输入新密码"
/>
</
Form
.
Item
>
<
Form
.
Item
className=
{
styles
.
btn
}
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
loading
}
>
{
'
'
}
确认修改
</
Button
>
<
Button
type=
"primary"
ghost
onClick=
{
goHome
}
>
...
...
src/pages/password/style.less
View file @
980438d3
...
...
@@ -22,6 +22,7 @@
&:first-child {
width: 200px;
margin-right: 10px;
margin-bottom: 10px;
}
}
}
...
...
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