Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
whb
9 years ago
Commit
d99d401a2d77e1d7ad3019fa1bc5f00e6df579a7
1 parent
91c80131
手机验证
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
web-static/js/passport/vertification.js
yohobuy/www.yohobuy.com/application/modules/Passport/controllers/Back.php
web-static/js/passport/vertification.js
View file @
d99d401
...
...
@@ -80,7 +80,8 @@ $('#captcha').keyup(function() {
url
:
'/passport/back/backmobile'
,
dataType
:
'json'
,
data
:
{
verifyCode
:
$
(
'#captcha'
).
val
(),
code
:
$
(
'#captcha'
).
val
(),
verifyCode
:
$
(
"#captchaPic"
).
val
(),
area
:
$
(
'#area'
).
val
(),
mobile
:
$
(
'#mobile'
).
val
()
},
...
...
yohobuy/www.yohobuy.com/application/modules/Passport/controllers/Back.php
View file @
d99d401
...
...
@@ -46,11 +46,14 @@ class BackController extends WebAction {
$data
[
'code'
]
=
400
;
}
}
else
if
(
Helpers
::
verifyMobile
(
$phoneNum
))
{
if
(
empty
(
PassportModel
::
getUserInfoByMobile
(
$
phoneNum
,
$area
)))
{
if
(
empty
(
PassportModel
::
getUserInfoByMobile
(
$
area
,
$phoneNum
)))
{
$data
[
'message'
]
=
'该账户不存在'
;
$data
[
'code'
]
=
400
;
}
}
}
else
{
$data
[
'message'
]
=
'验证失败'
;
$data
[
'code'
]
=
400
;
}
echo
$this
->
echoJson
(
$data
);
}
...
...
@@ -126,7 +129,8 @@ class BackController extends WebAction {
/**
* 重置密码页面
*/
public
function
backcodeAction
()
{
public
function
backcodeAction
()
{
$code
=
$this
->
get
(
'code'
);
$info
=
$this
->
checkCode
(
$code
);
if
(
empty
(
$info
))
{
...
...
@@ -149,7 +153,8 @@ class BackController extends WebAction {
/**
* 更新密码接口
*/
public
function
updateAction
()
{
public
function
updateAction
()
{
$code
=
$this
->
post
(
'code'
);
$password
=
$this
->
post
(
'pwd'
);
$info
=
$this
->
checkCode
(
$code
);
...
...
@@ -175,7 +180,8 @@ class BackController extends WebAction {
/**
* 重置密码成功
*/
public
function
resetSuccessAction
()
{
public
function
resetSuccessAction
()
{
$banner
=
PassportModel
::
getLeftBanner
(
PassportModel
::
BACK_LFFT_BANNER_CODE
);
$data
=
array
(
'simpleHeader'
=>
PassportModel
::
getSimpleHeader
(
false
),
...
...
@@ -191,7 +197,8 @@ class BackController extends WebAction {
/**
* 手机验证页面
*/
public
function
verificationAction
()
{
public
function
verificationAction
()
{
$mobile
=
$this
->
getSession
(
'mobile'
);
$area
=
$this
->
getSession
(
'area'
);
$verifyCode
=
$this
->
getSession
(
'verifyCode'
);
...
...
@@ -217,13 +224,14 @@ class BackController extends WebAction {
/**
* 手机找回密码验证
*/
public
function
backmobileAction
()
{
public
function
backmobileAction
()
{
$mobile
=
$this
->
post
(
'mobile'
);
$area
=
$this
->
post
(
'area'
);
$verifyCode
=
$this
->
post
(
'verifyCode'
);
$code
=
$this
->
post
(
'code'
);
// code
$data
=
array
(
'code'
=>
400
,
'message'
=>
'验证码错误!'
,
'data'
=>
SITE_MAIN
.
'/passport/back/index'
);
if
(
$this
->
getSession
(
'mobile'
)
==
$mobile
&&
$this
->
getSession
(
'area'
)
==
$area
)
{
if
(
$this
->
getSession
(
'mobile'
)
==
$mobile
&&
$this
->
getSession
(
'area'
)
==
$area
&&
!
empty
(
$code
)
)
{
$result
=
BackData
::
validateMobileCode
(
$mobile
,
$code
,
$area
);
if
(
$result
[
'code'
]
==
200
)
{
$str
=
json_encode
(
array
(
...
...
@@ -248,7 +256,8 @@ class BackController extends WebAction {
* @param string $code
* @return boolean
*/
private
function
checkCode
(
$code
)
{
private
function
checkCode
(
$code
)
{
$code
=
base64_decode
(
$code
);
$info
=
json_decode
(
AuthCode
::
decode
(
$code
,
PassportModel
::
BACK_FIND_SECRET_KEY
),
true
);
if
(
$info
[
'create_time'
]
<
1
||
(
time
()
-
$info
[
'create_time'
])
>
86400
)
{
...
...
Please
register
or
login
to post a comment