Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BCDH-APP
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
首开风险隐患双控平台
BCDH-APP
Commits
630ea071
Commit
630ea071
authored
Aug 22, 2022
by
王李辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改密码加入低中高强度校验
parent
880d1037
Pipeline
#8716
passed with stage
in 5 minutes and 21 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
191 additions
and
103 deletions
+191
-103
src/views/my/resetPas.vue
src/views/my/resetPas.vue
+191
-103
No files found.
src/views/my/resetPas.vue
View file @
630ea071
...
...
@@ -25,6 +25,7 @@
type=
"password"
name=
"newPassword"
label=
"新密码"
@
input=
"checkPassword()"
placeholder=
"请输入新密码"
:rules=
"[
{ required: true, message: '请填写密码' },
...
...
@@ -36,6 +37,20 @@
},
]"
/>
<!-- 密码等级提示 -->
<van-cell-group>
<div
class=
"intensity"
>
<div
style=
"width: 8.2em; margin-right: 0.32rem;"
></div>
<div>
<div
class=
"pass-level"
>
<span
class=
"psdText"
>
密码强度
</span>
<span
class=
"line"
:class=
"[level.includes('low') ? 'low' : '']"
></span>
<span
class=
"line"
:class=
"[level.includes('middle') ? 'middle' : '']"
></span>
<span
class=
"line"
:class=
"[level.includes('high') ? 'high' : '']"
></span>
</div>
</div>
</div>
</van-cell-group>
<van-field
required
v-model=
"form.confirm"
...
...
@@ -79,6 +94,7 @@ export default {
newPassword
:
""
,
confirm
:
""
,
},
level
:
[]
};
},
mounted
()
{
...
...
@@ -95,14 +111,13 @@ export default {
loadingType
:
"
spinner
"
,
duration
:
0
,
});
postFun
(
"
/mobile/resetPwd
"
,
this
.
obj2formdata
(
val
))
.
then
((
data
)
=>
{
postFun
(
"
/mobile/resetPwd
"
,
this
.
obj2formdata
(
val
)).
then
((
data
)
=>
{
if
(
data
.
code
==
0
)
{
this
.
$toast
.
clear
();
this
.
$toast
.
success
(
'
密码修改成功!
'
);
this
.
$router
.
back
()
this
.
$toast
.
success
(
"
密码修改成功!
"
);
this
.
$router
.
back
();
}
})
});
},
obj2formdata
(
data
)
{
console
.
log
(
data
,
"
fasfasdfsd
"
);
...
...
@@ -114,9 +129,82 @@ export default {
}
return
fd
;
},
// 密码等级校验
checkPassword
()
{
this
.
level
=
[];
// 校验是数字
const
regex1
=
/^
\d
+$/
;
// 校验字母
const
regex2
=
/^
[
A-Za-z
]
+$/
;
// 校验符号
const
regex3
=
/^
[
`~!@#$%^&*()_
\-
+=<>?:"{}|,.
\/
;'
\\
[
\]
·~!@#¥%……&*()——
\-
+={}|《》?:“”【】、;‘',。、
]
+$/
;
if
(
regex1
.
test
(
this
.
form
.
newPassword
))
{
this
.
level
.
push
(
"
low
"
);
}
else
if
(
regex2
.
test
(
this
.
form
.
newPassword
))
{
this
.
level
.
push
(
"
low
"
);
}
else
if
(
regex3
.
test
(
this
.
form
.
newPassword
))
{
this
.
level
.
push
(
"
low
"
);
}
else
if
(
/^
[
A-Za-z
\d]
+$/
.
test
(
this
.
form
.
newPassword
))
{
this
.
level
.
push
(
"
low
"
);
this
.
level
.
push
(
"
middle
"
);
}
else
if
(
/^
[
`~!@#$%^&*()_
\-
+=<>?:"{}|,.
\/
;'
\\
[
\]
·~!@#¥%……&*()——
\-
+={}|《》?:“”【】、;‘',。、
\d]
+$/
.
test
(
this
.
form
.
newPassword
)
)
{
this
.
level
.
push
(
"
low
"
);
this
.
level
.
push
(
"
middle
"
);
}
else
if
(
/^
[
`~!@#$%^&*()_
\-
+=<>?:"{}|,.
\/
;'
\\
[
\]
·~!@#¥%……&*()——
\-
+={}|《》?:“”【】、;‘',。、A-Za-z
]
+$/
.
test
(
this
.
form
.
newPassword
)
)
{
this
.
level
.
push
(
"
low
"
);
this
.
level
.
push
(
"
middle
"
);
}
else
if
(
/^
[
`~!@#$%^&*()_
\-
+=<>?:"{}|,.
\/
;'
\\
[
\]
·~!@#¥%……&*()——
\-
+={}|《》?:“”【】、;‘',。、A-Za-z
\d]
+$/
.
test
(
this
.
form
.
newPassword
)
)
{
this
.
level
.
push
(
"
low
"
);
this
.
level
.
push
(
"
middle
"
);
this
.
level
.
push
(
"
high
"
);
}
},
},
};
</
script
>
<
style
>
<
style
lang=
"less"
scoped
>
.intensity {
display: flex;
padding: 0.26667rem 0.42667rem;
line-height: 0.64rem;
.psdText {
font-size: 14px;
margin-right: 10px;
}
.line {
display: inline-block;
width: 48px;
height: 4px;
background: #d8d8d8;
border-radius: 3px;
margin-right: 8px;
}
.low {
background: #f4664a;
}
.middle {
background: #ffb700;
}
.high {
background: #2cbb79;
}
}
</
style
>
\ No newline at end of file
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