Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
whb
9 years ago
Commit
26c3d12c08570bc7d45b447ceace11f9f2f2a0e8
1 parent
4bfc8520
找回密码
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
yohobuy/www.yohobuy.com/application/modules/Passport/controllers/Back.php
yohobuy/www.yohobuy.com/application/modules/Passport/controllers/Back.php
View file @
26c3d12
...
...
@@ -67,27 +67,29 @@ class BackController extends WebAction {
$phoneNum
=
$this
->
post
(
'phoneNum'
,
''
);
$area
=
intval
(
$this
->
post
(
'area'
,
'86'
));
$verifyCode
=
$this
->
post
(
'verifyCode'
,
''
);
//图形验证码
$ret
=
false
;
if
(
Helpers
::
verifyEmail
(
$phoneNum
))
{
// 验证邮箱
$email
=
$phoneNum
;
$data
=
BackData
::
sendCodeToEmail
(
$email
);
if
(
$data
[
'code'
]
==
200
)
{
$ret
=
true
;
$this
->
setSession
(
'email'
,
$email
);
return
$this
->
redirect
(
'sendemail'
);
}
else
{
return
$this
->
redirect
(
'index'
);
}
}
}
else
if
(
Helpers
::
verifyMobile
(
$phoneNum
))
{
// 验证手机号
$mobile
=
$phoneNum
;
$data
=
BackData
::
sendCodeToMobile
(
$mobile
,
$area
);
if
(
$data
[
'code'
]
==
200
)
{
$ret
=
true
;
$this
->
setSession
(
'mobile'
,
$mobile
);
$this
->
setSession
(
'area'
,
$area
);
$this
->
setSession
(
'verifyCode'
,
$verifyCode
);
return
$this
->
redirect
(
'verification'
);
}
else
{
return
$this
->
redirect
(
'index'
);
}
}
}
if
(
!
$ret
)
{
//重新找回密码页
return
$this
->
redirect
(
'index'
);
}
}
...
...
@@ -184,6 +186,7 @@ class BackController extends WebAction {
$code
=
$this
->
post
(
'code'
);
//加密code兼容以前参数
$password
=
$this
->
post
(
'pwd'
);
$info
=
$this
->
checkCode
(
$code
);
$ret
=
false
;
if
(
Helpers
::
verifyPassword
(
$password
))
{
if
(
!
empty
(
$info
))
{
//手机号找回
// 修改密码
...
...
@@ -193,18 +196,22 @@ class BackController extends WebAction {
$area
=
$info
[
'area'
];
$data
=
BackData
::
modifyPasswordByMobile
(
$mobile
,
$token
,
$password
,
$area
);
if
(
$data
[
'code'
]
==
200
)
{
return
$this
->
redirect
(
'resetsuccess'
)
;
$ret
=
true
;
}
}
else
if
(
isset
(
$info
[
'uid'
]))
{
//其他方式修改密码,跳到找回密码首页
return
$this
->
redirect
(
'index'
)
;
$ret
=
false
;
}
}
else
{
//新版邮箱修改接口
$data
=
BackData
::
modifyPasswordByEmailCode
(
$code
,
$password
);
if
(
$data
[
'code'
]
==
200
)
{
return
$this
->
redirect
(
'resetsuccess'
)
;
$ret
=
true
;
}
}
}
else
{
}
if
(
$ret
)
{
//跳转到成功页
return
$this
->
redirect
(
'resetsuccess'
);
}
else
{
// 跳转错误页面
return
$this
->
redirect
(
'index'
);
}
...
...
Please
register
or
login
to post a comment