Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
7 years ago
Commit
935eb915933aab9bb253537b1237e96c363e80b1
1 parent
15a96110
check页添加reqid
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
4 deletions
apps/3party/controllers/robot-check.js
apps/3party/views/action/robot-check.hbs
apps/home/models/favorite-model.js
doraemon/middleware/limiter/index.js
apps/3party/controllers/robot-check.js
View file @
935eb91
...
...
@@ -7,9 +7,14 @@ const simpleHeaderModel = require('../../../doraemon/models/simple-header');
const
logger
=
global
.
yoho
.
logger
;
const
index
=
(
req
,
res
)
=>
{
let
remoteIp
=
req
.
yoho
.
clientIp
||
''
;
logger
.
info
(
`
limit
remote
ip
:
$
{
remoteIp
};
ua
:
$
{
req
.
header
(
'User-Agent'
)};
uid
:
$
{
req
.
user
.
uid
};
reqId
:
$
{
req
.
reqID
}
`
);
// eslint-disable-line
return
res
.
render
(
'robot-check'
,
{
module
:
'3party'
,
page
:
'robot-check'
,
reqId
:
req
.
reqID
,
simpleHeader
:
simpleHeaderModel
.
setSimpleHeaderData
()
});
};
...
...
apps/3party/views/action/robot-check.hbs
View file @
935eb91
<div
class=
"robot-check-page yoho-page"
>
<div
class=
"robot-check-page yoho-page"
data-reqid=
"
{{
reqId
}}
"
>
<div
class=
"captcha"
>
<div
class=
"title"
>
您的操作太频繁了~请完成以下操作后继续
</div>
<div
class=
"captcha-wrap"
>
</div>
...
...
apps/home/models/favorite-model.js
View file @
935eb91
...
...
@@ -224,7 +224,7 @@ module.exports = class favorite extends global.yoho.BaseModel {
url
=
helpers
.
urlFormat
(
`
/
shop
/
$
{
item
.
brand_domain
}
-
$
{
item
.
shop_id
}.
html
`
,
null
);
break
;
case
'brand'
:
url
=
helpers
.
urlFormat
(
`
/
search
/
`
,
{
brand
:
item
.
brand_id
});
url
=
helpers
.
urlFormat
(
'/search/'
,
{
brand
:
item
.
brand_id
});
break
;
default
:
break
;
...
...
doraemon/middleware/limiter/index.js
View file @
935eb91
...
...
@@ -91,8 +91,6 @@ module.exports = (req, res, next) => {
if
(
exclusion
)
{
return
next
();
}
else
if
(
!
allPass
&&
policy
)
{
logger
.
info
(
`
limit
remote
ip
:
$
{
remoteIp
};
ua
:
$
{
req
.
header
(
'User-Agent'
)};
uid
:
$
{
req
.
user
.
uid
}
`
);
policy
(
req
,
res
,
next
);
}
else
{
return
next
();
...
...
Please
register
or
login
to post a comment