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
郝肖肖
7 years ago
Commit
a994b7cc60105e5a9b8668d4c9417b2733e32058
2 parents
6c274659
8ae72324
Merge branch 'release/6.5.3' of git.yoho.cn:fe/yohobuywap-node into release/6.5.3
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
67 additions
and
31 deletions
app.js
apps/api/controllers/miniapp.js
apps/api/router.js
apps/home/models/orderDetail.js
config/common.js
doraemon/middleware/limiter/index.js
doraemon/middleware/url-rewrite.js
public/static/OFRuhJ43rY.txt
public/static/robots.txt
app.js
View file @
a994b7c
...
...
@@ -153,8 +153,6 @@ try {
app
.
use
(
itemNameHandler
);
app
.
use
(
setYohoData
());
app
.
use
(
user
());
app
.
use
(
seo
());
app
.
use
(
setPageInfo
());
// 请求限制中间件
if
(
!
app
.
locals
.
devEnv
)
{
...
...
@@ -165,6 +163,8 @@ try {
app
.
use
(
devtools
());
}
app
.
use
(
seo
());
app
.
use
(
setPageInfo
());
app
.
use
(
layoutTools
());
app
.
use
(
pageCache
());
app
.
use
(
routeEncode
.
md
);
...
...
apps/api/controllers/miniapp.js
View file @
a994b7c
...
...
@@ -4,7 +4,18 @@
const
path
=
require
(
'path'
);
module
.
exports
=
{
/**
* 有货小程序验证
*/
verify
(
req
,
res
)
{
res
.
sendFile
(
path
.
join
(
__dirname
,
'../../../public/static/hfxRaNY27L.txt'
));
},
/**
* 线下店小程序验证
*/
store
(
req
,
res
)
{
res
.
sendFile
(
path
.
join
(
__dirname
,
'../../../public/static/OFRuhJ43rY.txt'
));
}
};
...
...
apps/api/router.js
View file @
a994b7c
...
...
@@ -40,7 +40,13 @@ router.get('/activity/manifest.json', pwa.manifest);
// 小程序使用的域名验证文件
router
.
get
(
'/hfxRaNY27L.txt'
,
miniapp
.
verify
);
router
.
get
(
'/activity/hfxRaNY27L.txt'
,
miniapp
.
verify
);
router
.
get
(
'/shop/hfxRaNY27L.txt'
,
miniapp
.
verify
);
router
.
get
(
'/
product/
shop/hfxRaNY27L.txt'
,
miniapp
.
verify
);
router
.
get
(
'/product/hfxRaNY27L.txt'
,
miniapp
.
verify
);
// 线下店使用的域名验证文件
router
.
get
(
'/OFRuhJ43rY.txt'
,
miniapp
.
store
);
router
.
get
(
'/activity/OFRuhJ43rY.txt'
,
miniapp
.
store
);
router
.
get
(
'/product/shop/OFRuhJ43rY.txt'
,
miniapp
.
store
);
router
.
get
(
'/product/OFRuhJ43rY.txt'
,
miniapp
.
store
);
module
.
exports
=
router
;
...
...
apps/home/models/orderDetail.js
View file @
a994b7c
...
...
@@ -201,14 +201,9 @@ module.exports = class extends global.yoho.BaseModel {
});
}
if
(
orderDetail
.
links
)
{
_
.
forEach
(
orderDetail
.
links
,
(
val
)
=>
{
if
(
val
===
'getExpress'
)
{
orderDetail
=
_
.
assign
(
orderDetail
,
{
expressUrl
:
helpers
.
urlFormat
(
'/home/logistic'
,
{
order_code
:
orderCode
})
});
return
;
}
if
(
_
.
get
(
orderDetail
,
'orderDetailInfo.ext.needHref'
)
===
'Y'
)
{
orderDetail
=
_
.
assign
(
orderDetail
,
{
expressUrl
:
helpers
.
urlFormat
(
'/home/logistic'
,
{
order_code
:
orderCode
})
});
}
...
...
config/common.js
View file @
a994b7c
...
...
@@ -148,17 +148,17 @@ module.exports = {
}
},
REQUEST_LIMIT
:
{
// 10s 最多访问5次
10
:
10
,
// 10s 最多访问20次
10
:
20
,
// 30s 最多访问15次
30
:
20
,
// 30s 最多访问40次
30
:
40
,
// 60s 最多访问15次
60
:
30
,
// 60s 最多访问60次
60
:
60
,
// 100s 最多访问15次
600
:
100
// 100s 最多访问200次
600
:
200
},
superCapture
:
'93c70db61fe276f93ce781ad17dc47cd'
,
from
:
from
...
...
doraemon/middleware/limiter/index.js
View file @
a994b7c
...
...
@@ -19,18 +19,33 @@ const IP_WHITE_LIST = [
'218.94.75.58'
,
'218.94.75.50'
,
'218.94.77.166'
,
'10.66.70.21'
,
// 联盟 生产 IP
'222.73.196.18'
// B站合作方单击次数快加白名单
];
const
PATH_WHITE_LIST
=
[
'/3party/check'
,
'/3party/check/submit'
,
'/passport/imagesNode'
,
'/passport/cert/headerTip'
,
'/passport/captcha/get'
,
'/passport/images'
,
'/passport/img-check.jpg'
,
'/passport/geetest/register'
'/passport/geetest/register'
,
'/activity/individuation'
,
'/activity/individuation/coupon'
,
'/activity/share'
,
'/activity/wechat/share'
,
'/activity/wechat/1111'
,
'/api/switch'
,
'/passport/login/user'
,
'/sw.js'
,
'/manifest.json'
,
'/activity/sw.js'
,
'/activity/manifest.json'
,
'/hfxRaNY27L.txt'
,
'/activity/hfxRaNY27L.txt'
,
'/product/shop/hfxRaNY27L.txt'
,
'/product/hfxRaNY27L.txt'
,
'/.well-known/apple-app-site-association'
,
'/service/sitemap.xml'
];
const
limiter
=
(
rule
,
policy
,
context
)
=>
{
...
...
doraemon/middleware/url-rewrite.js
View file @
a994b7c
...
...
@@ -59,7 +59,7 @@ module.exports = () => {
req
.
url
=
`
/
product
/
search$
{
req
.
path
}
`
;
}
if
(
/^
\/(
list|shop
)
/
.
test
(
req
.
url
)
&&
req
.
url
.
indexOf
(
'hfxRaNY27L'
)
<
0
)
{
if
(
/^
\/(
list|shop
)
/
.
test
(
req
.
url
))
{
// 商品列表页、全球购商品列表页、店铺首页路由
req
.
url
=
`
/
product$
{
req
.
url
}
`
;
}
...
...
public/static/OFRuhJ43rY.txt
0 → 100644
View file @
a994b7c
84e2e0416b10c7872b4983ad2c63892e
\ No newline at end of file
...
...
public/static/robots.txt
View file @
a994b7c
User-Agent: *
Disallow: /passport
Disallow: /cart
Disallow: /passport/
Disallow: /cart/
Disallow: /home/
Disallow: /service/
Disallow: /3party
Disallow: /api
Disallow: /hf
Disallow: /rn
Sitemap: https://m.yohobuy.com/sitemap.xml
\ No newline at end of file
Disallow: /3party/
Disallow: /api/
Disallow: /hf/
Disallow: /rn/
Disallow: /*?*
Disallow: /coupon/
Disallow: /brands/search/
Disallow: /activity/
Disallow: /product/detail/
Disallow: /reg.html
Disallow: /signin.html
Disallow: /search/
...
...
Please
register
or
login
to post a comment