Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1
Overview
Overview
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
吴迪
gs1
Commits
49f96980
Commit
49f96980
authored
Dec 26, 2021
by
tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 找回密码
parent
f470ca25
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
30 deletions
+72
-30
user.js
src/axios/module/user.js
+10
-0
reset-pass.vue
src/views/User/reset-pass.vue
+62
-30
No files found.
src/axios/module/user.js
View file @
49f96980
...
...
@@ -19,8 +19,18 @@ const code = (params = {}) => {
return
POST
(
`
${
Prefix
}
/office/timescoderegi/api/getVerificationCode`
,
params
)
}
const
resetPasswordByMobile
=
(
params
=
{})
=>
{
return
POST
(
`
${
Prefix
}
/office/timescodefindps/api/forgotPasswordPhone`
,
params
)
}
const
resetPasswordByEmail
=
(
params
=
{})
=>
{
return
POST
(
`
${
Prefix
}
/office/timescodefindps/api/forgotPasswordEmiail`
,
params
)
}
export
default
{
login
,
register
,
code
,
resetPasswordByMobile
,
resetPasswordByEmail
,
}
src/views/User/reset-pass.vue
View file @
49f96980
...
...
@@ -3,8 +3,11 @@
<div
class=
"reset-pass"
>
<el-tabs
v-model=
"activeName"
class=
"tab-no-bottom"
>
<el-tab-pane
label=
"手机号找回"
name=
"first"
>
<el-form
:model=
"mobileForm"
status-icon
>
<el-form-item>
<el-form
ref=
"mobileForm"
:model=
"mobileForm"
status-icon
>
<el-form-item
prop=
'userName'
:rules=
"[
{
required: true,
message: '不能为空',
}]">
<el-input
v-model=
"mobileForm.userName"
placeholder=
"请输入用户名"
></el-input>
</el-form-item>
...
...
@@ -35,8 +38,11 @@
</el-tab-pane>
<el-tab-pane
label=
"邮箱找回"
name=
"second"
>
<el-form
:model=
"emailForm"
status-icon
>
<el-form-item>
<el-form
ref=
"emailForm"
:model=
"emailForm"
status-icon
>
<el-form-item
prop=
'userName'
:rules=
"[{
required: true,
message: '不能为空',
}]"
>
<el-input
v-model=
"emailForm.userName"
placeholder=
"请输入用户名"
></el-input>
</el-form-item>
...
...
@@ -125,34 +131,60 @@ export default {
},
methods
:
{
resetByMobile
()
{
if
(
this
.
mobileForm
.
mobile
===
''
)
{
this
.
$message
({
type
:
'error'
,
message
:
'请输入手机号码'
});
}
else
{
this
.
hasSent
=
true
;
this
.
timer
=
setInterval
(()
=>
{
this
.
time
-=
1
;
if
(
this
.
time
===
0
)
{
clearInterval
(
this
.
timer
);
this
.
time
=
60
;
this
.
hasSent
=
false
;
}
},
1000
);
}
this
.
$refs
[
'mobileForm'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
$api
.
user
.
resetPasswordByMobile
({
"userName"
:
this
.
mobileForm
.
userName
,
"phone"
:
this
.
mobileForm
.
mobile
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
success
)
{
this
.
$message
.
success
(
res
.
returnMsg
||
'发送成功,请注意查收'
)
this
.
hasSent
=
true
;
this
.
timer
=
setInterval
(()
=>
{
this
.
time
-=
1
;
if
(
this
.
time
===
0
)
{
clearInterval
(
this
.
timer
);
this
.
time
=
60
;
this
.
hasSent
=
false
;
}
},
1000
);
}
else
{
this
.
$message
.
error
(
res
.
returnMsg
||
'网络错误,请稍后再试'
)
}
})
}
})
},
resetByEmail
()
{
if
(
this
.
emailForm
.
email
===
''
)
{
this
.
$message
({
type
:
'error'
,
message
:
'请输入邮箱号'
});
}
else
{
this
.
hasSent
=
true
;
this
.
timer
=
setInterval
(()
=>
{
this
.
time
-=
1
;
if
(
this
.
time
===
0
)
{
clearInterval
(
this
.
timer
);
this
.
time
=
60
;
this
.
hasSent
=
false
;
}
},
1000
);
}
this
.
$refs
[
'emailForm'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
$api
.
user
.
resetPasswordByEmail
({
"userName"
:
this
.
emailForm
.
userName
,
"e-miail"
:
this
.
emailForm
.
email
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
success
)
{
this
.
$message
.
success
(
res
.
returnMsg
||
'发送成功,请注意查收'
)
this
.
hasSent
=
true
;
this
.
timer
=
setInterval
(()
=>
{
this
.
time
-=
1
;
if
(
this
.
time
===
0
)
{
clearInterval
(
this
.
timer
);
this
.
time
=
60
;
this
.
hasSent
=
false
;
}
},
1000
);
}
else
{
this
.
$message
.
error
(
res
.
returnMsg
||
'网络错误,请稍后再试'
)
}
})
}
})
// if (this.emailForm.email === '') {
// this.$message({type: 'error', message: '请输入邮箱号'});
// } else {
// }
}
},
}
...
...
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