Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
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
Plain Diff
Browse Files
Authored by
毕凯
8 years ago
Commit
383b264f0d82b95bc15f7e50a5bac4019c6f846c
2 parents
bba1b48c
f72bbe10
Merge branch 'hotfix/verifymodified' into 'master'
verify-switch See merge request
!883
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
apps/passport/controllers/validateCode.js
doraemon/views/partial/analysis.hbs
apps/passport/controllers/validateCode.js
View file @
383b264
...
...
@@ -29,14 +29,23 @@ const check = (req, res, next) => {
co
(
function
*
()
{
// 如果是账号密码登录,那么需要检查是否登录失败过,登录失败过展示验证码
if
(
req
.
path
===
'/passport/login/auth'
)
{
let
hasErrorLog
=
yield
cache
.
get
(
`
loginErrorIp
:
$
{
req
.
yoho
.
clientIp
}
`
);
// 第一次登录要不要展示验证码:后台开关勾选,首次登录不需要展示
let
firstLoginShowCaptcha
=
!
_
.
get
(
req
.
app
.
locals
.
wap
,
'close.firstLoginShowCaptcha'
,
false
);
log
.
info
(
`
Check
clientip
$
{
req
.
yoho
.
clientIp
}
status
is
`
+
hasErrorLog
);
log
.
info
(
`
firstLoginShowCaptcha
status
is
$
{
firstLoginShowCaptcha
}
`
);
if
(
hasErrorLog
)
{
if
(
firstLoginShowCaptcha
)
{
req
.
yoho
.
captchaShow
=
true
;
}
else
{
req
.
yoho
.
captchaShow
=
false
;
let
hasErrorLog
=
yield
cache
.
get
(
`
loginErrorIp
:
$
{
req
.
yoho
.
clientIp
}
`
);
log
.
info
(
`
Check
clientip
$
{
req
.
yoho
.
clientIp
}
status
is
`
+
hasErrorLog
);
if
(
hasErrorLog
)
{
req
.
yoho
.
captchaShow
=
true
;
}
else
{
req
.
yoho
.
captchaShow
=
false
;
}
}
}
...
...
doraemon/views/partial/analysis.hbs
View file @
383b264
...
...
@@ -60,6 +60,13 @@
}
setTimeout(function() {
{{#if
@root
.
isLogin
}}
{{#if
@root
.
isApp
}}
_hmt.push(['_setCustomVar', 3, 'login', 'APP', 2]);
{{^}}
_hmt.push(['_setCustomVar', 3, 'login', 'H5', 2]);
{{/if}}
{{/if}}
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
...
...
@@ -72,14 +79,6 @@
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})(); --}}
{{#if
@root
.
isLogin
}}
{{#if
@root
.
isApp
}}
_hmt.push(['_setCustomVar', 3, 'login', 'APP', 2]);
{{^}}
_hmt.push(['_setCustomVar', 3, 'login', 'H5', 2]);
{{/if}}
{{/if}}
},
1000
);
}());
...
...
Please
register
or
login
to post a comment