Authored by 李靖

Merge branch 'master' of git.yoho.cn:fe/yohobuywap-node

... ... @@ -154,8 +154,6 @@ try {
app.use(itemNameHandler);
app.use(setYohoData());
app.use(user());
app.use(seo());
app.use(setPageInfo());
// 请求限制中间件
if (!app.locals.devEnv) {
... ... @@ -166,6 +164,8 @@ try {
app.use(devtools());
}
app.use(seo());
app.use(setPageInfo());
app.use(layoutTools());
app.use(pageCache());
app.use(routeEncode.md);
... ...
... ... @@ -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'));
}
};
... ...
... ... @@ -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;
... ...
... ... @@ -26,29 +26,26 @@ const IP_WHITE_LIST = [
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',
'/activity/individuation/productLst',
'/activity/individuation',
'/activity/individuation/coupon',
'/activity/share',
'/activity/wechat/share',
'/activity/wechat/1111',
'/api/switch',
'/passport/login/user',
'/api/sw.js',
'/api/manifest.json',
'/api/activity/sw.js',
'/api/activity/manifest.json',
'/api/hfxRaNY27L.txt',
'/api/activity/hfxRaNY27L.txt',
'/api/shop/hfxRaNY27L.txt',
'/api/product/hfxRaNY27L.txt',
'/api/.well-known/apple-app-site-association',
'/sitemap.xml'
'/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) => {
... ...
... ... @@ -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}`;
}
... ...
84e2e0416b10c7872b4983ad2c63892e
\ No newline at end of file
... ...
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/
... ...