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
Plain Diff
Browse Files
Authored by
陈峰
7 years ago
Commit
33e5bcdefc71214aa76f3e014143d4a87f393719
2 parents
5bb51541
5e8efbe3
Merge branch 'gray' into 'master'
Gray See merge request
!350
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
8 deletions
apps/3party/controllers/robot-check.js
apps/3party/views/action/robot-check.hbs
apps/cart/models/order-ensure.js
apps/home/models/favorite-model.js
apps/product/models/sale.js
doraemon/middleware/limiter/index.js
apps/3party/controllers/robot-check.js
View file @
33e5bcd
...
...
@@ -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 @
33e5bcd
<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/cart/models/order-ensure.js
View file @
33e5bcd
...
...
@@ -88,7 +88,7 @@ module.exports = class extends global.yoho.BaseModel {
ensureHandleModel
.
handleViewPrice
(
result
.
data
.
promotion_formula_list
);
}
result
.
data
=
Object
.
assign
(
result
.
data
,
ensureHandleModel
.
handleUseYohoCoin
(
result
.
data
));
result
.
data
=
Object
.
assign
(
result
.
data
||
{}
,
ensureHandleModel
.
handleUseYohoCoin
(
result
.
data
));
}
return
result
;
...
...
apps/home/models/favorite-model.js
View file @
33e5bcd
...
...
@@ -217,13 +217,25 @@ module.exports = class favorite extends global.yoho.BaseModel {
}
result
.
brands
=
_
.
get
(
brand
,
'data.brand_list'
,
[]).
map
((
item
)
=>
{
let
url
=
''
;
switch
(
item
.
brandOrShopType
)
{
case
'shop'
:
url
=
helpers
.
urlFormat
(
`
/
shop
/
$
{
item
.
brand_domain
}
-
$
{
item
.
shop_id
}.
html
`
,
null
);
break
;
case
'brand'
:
url
=
helpers
.
urlFormat
(
'/search/'
,
{
brand
:
item
.
brand_id
});
break
;
default
:
break
;
}
return
{
id
:
item
.
brand_id
,
brandOrShopType
:
item
.
brandOrShopType
||
''
,
shop_id
:
item
.
shop_id
||
''
,
img
:
helpers
.
image
(
item
.
brand_ico
,
100
,
100
),
url
:
helpers
.
urlFormat
(
`
/
shop
/
$
{
item
.
brand_domain
}
-
$
{
item
.
shop_id
}.
html
`
,
null
),
url
:
url
,
name
:
item
.
brand_name
,
naCount
:
item
.
new_product_num
,
colCount
:
item
.
brand_favorite_num
...
...
apps/product/models/sale.js
View file @
33e5bcd
...
...
@@ -406,17 +406,19 @@ function getSaleDiscountData(params, channel) {
}
}
let
productPool
=
_
.
get
(
result
,
'[1].data[0].product_pool'
);
// 这里把 channel 全都处理掉,因为根据channel查小分类,而传入商品池时,不需要
return
Promise
.
all
([
this
.
saleApi
.
getSaleGoodsList
({
channel
:
null
,
saleType
:
'3'
,
limit
:
'1'
,
productPool
:
result
[
1
].
data
[
0
].
product_p
ool
productPool
:
productP
ool
}),
this
.
saleApi
.
getSaleGoodsList
(
Object
.
assign
({},
params
,
{
channel
:
null
,
productPool
:
result
[
1
].
data
[
0
].
product_p
ool
productPool
:
productP
ool
}))
]).
then
(
subResult
=>
{
// 删除无用参数
...
...
doraemon/middleware/limiter/index.js
View file @
33e5bcd
...
...
@@ -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