Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
陈峰
8 years ago
Commit
65c0d7a922462b2dcf21fe27832b89c725f42ede
2 parents
5fd63315
a09c437d
Merge branch 'feature/safe-bug' into gray
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
22 deletions
public/js/passport/reg/reg.js
public/js/passport/reg/reg.js
View file @
65c0d7a
...
...
@@ -162,8 +162,10 @@ function validateImgCaptcha() {
}()).
then
(
function
()
{
hideTip
(
$imgCaptchaInput
);
ep
.
emit
(
'captcha-img'
,
true
);
return
true
;
}).
fail
(
function
()
{
ep
.
emit
(
'captcha-img'
,
false
);
return
false
;
});
}
...
...
@@ -196,14 +198,11 @@ function validateSMSCaptchaAsync() {
return
false
;
}
switch
(
data
.
code
)
{
case
200
:
return
true
;
case
400
:
errTip
(
$smsCaptchaInput
,
'短信验证码错误'
);
return
false
;
default
:
return
false
;
if
(
data
.
code
===
200
)
{
return
true
;
}
else
{
errTip
(
$smsCaptchaInput
,
data
.
message
);
return
false
;
}
});
}
...
...
@@ -479,7 +478,7 @@ exports.init = function() {
// 验证图形输入
$imgCaptchaInput
.
on
(
'blur'
,
function
()
{
validateImgCaptcha
();
//
validateImgCaptcha();
$imgCaptchaInput
.
removeClass
(
'focus'
);
}).
on
(
'focus'
,
function
()
{
hideTip
(
$imgCaptchaInput
);
...
...
@@ -570,19 +569,28 @@ exports.init = function() {
// 点击发送验证码
$smsCaptchaCtrl
.
on
(
'click'
,
function
()
{
if
(
$smsCaptchaCtrl
.
hasClass
(
'disable'
)
||
$smsCaptchaCtrl
.
hasClass
(
'second-progress'
))
{
return
;
}
$smsCaptchaCtrl
.
addClass
(
'disable'
);
disableSMSBtn
();
sendSMSCaptcha
().
then
((
data
)
=>
{
if
(
data
.
code
!==
200
)
{
errTip
(
$imgCaptchaInput
,
data
.
message
);
refreshImgCaptcha
();
}
else
{
hideTip
(
$smsCaptchaInput
);
// if ($smsCaptchaCtrl.hasClass('disable') || $smsCaptchaCtrl.hasClass('second-progress')) {
// return;
// }
validateImgCaptcha
().
then
(
allow
=>
{
if
(
allow
)
{
$smsCaptchaCtrl
.
addClass
(
'disable'
);
disableSMSBtn
();
sendSMSCaptcha
().
then
((
data
)
=>
{
if
(
data
.
code
!==
200
)
{
if
(
data
.
code
===
404
)
{
errTip
(
$phoneNumInput
,
data
.
message
);
}
else
{
errTip
(
$imgCaptchaInput
,
data
.
message
);
}
refreshImgCaptcha
();
}
else
{
hideTip
(
$smsCaptchaInput
);
}
});
}
});
});
...
...
Please
register
or
login
to post a comment