Merge branch 'master' of git.yoho.cn:fe/yohobuywap-node
Showing
7 changed files
with
48 additions
and
25 deletions
@@ -154,8 +154,6 @@ try { | @@ -154,8 +154,6 @@ try { | ||
154 | app.use(itemNameHandler); | 154 | app.use(itemNameHandler); |
155 | app.use(setYohoData()); | 155 | app.use(setYohoData()); |
156 | app.use(user()); | 156 | app.use(user()); |
157 | - app.use(seo()); | ||
158 | - app.use(setPageInfo()); | ||
159 | 157 | ||
160 | // 请求限制中间件 | 158 | // 请求限制中间件 |
161 | if (!app.locals.devEnv) { | 159 | if (!app.locals.devEnv) { |
@@ -166,6 +164,8 @@ try { | @@ -166,6 +164,8 @@ try { | ||
166 | app.use(devtools()); | 164 | app.use(devtools()); |
167 | } | 165 | } |
168 | 166 | ||
167 | + app.use(seo()); | ||
168 | + app.use(setPageInfo()); | ||
169 | app.use(layoutTools()); | 169 | app.use(layoutTools()); |
170 | app.use(pageCache()); | 170 | app.use(pageCache()); |
171 | app.use(routeEncode.md); | 171 | app.use(routeEncode.md); |
@@ -4,7 +4,18 @@ | @@ -4,7 +4,18 @@ | ||
4 | const path = require('path'); | 4 | const path = require('path'); |
5 | 5 | ||
6 | module.exports = { | 6 | module.exports = { |
7 | + | ||
8 | + /** | ||
9 | + * 有货小程序验证 | ||
10 | + */ | ||
7 | verify(req, res) { | 11 | verify(req, res) { |
8 | res.sendFile(path.join(__dirname, '../../../public/static/hfxRaNY27L.txt')); | 12 | res.sendFile(path.join(__dirname, '../../../public/static/hfxRaNY27L.txt')); |
13 | + }, | ||
14 | + | ||
15 | + /** | ||
16 | + * 线下店小程序验证 | ||
17 | + */ | ||
18 | + store(req, res) { | ||
19 | + res.sendFile(path.join(__dirname, '../../../public/static/OFRuhJ43rY.txt')); | ||
9 | } | 20 | } |
10 | }; | 21 | }; |
@@ -40,7 +40,13 @@ router.get('/activity/manifest.json', pwa.manifest); | @@ -40,7 +40,13 @@ router.get('/activity/manifest.json', pwa.manifest); | ||
40 | // 小程序使用的域名验证文件 | 40 | // 小程序使用的域名验证文件 |
41 | router.get('/hfxRaNY27L.txt', miniapp.verify); | 41 | router.get('/hfxRaNY27L.txt', miniapp.verify); |
42 | router.get('/activity/hfxRaNY27L.txt', miniapp.verify); | 42 | router.get('/activity/hfxRaNY27L.txt', miniapp.verify); |
43 | -router.get('/shop/hfxRaNY27L.txt', miniapp.verify); | 43 | +router.get('/product/shop/hfxRaNY27L.txt', miniapp.verify); |
44 | router.get('/product/hfxRaNY27L.txt', miniapp.verify); | 44 | router.get('/product/hfxRaNY27L.txt', miniapp.verify); |
45 | 45 | ||
46 | +// 线下店使用的域名验证文件 | ||
47 | +router.get('/OFRuhJ43rY.txt', miniapp.store); | ||
48 | +router.get('/activity/OFRuhJ43rY.txt', miniapp.store); | ||
49 | +router.get('/product/shop/OFRuhJ43rY.txt', miniapp.store); | ||
50 | +router.get('/product/OFRuhJ43rY.txt', miniapp.store); | ||
51 | + | ||
46 | module.exports = router; | 52 | module.exports = router; |
@@ -26,29 +26,26 @@ const IP_WHITE_LIST = [ | @@ -26,29 +26,26 @@ const IP_WHITE_LIST = [ | ||
26 | const PATH_WHITE_LIST = [ | 26 | const PATH_WHITE_LIST = [ |
27 | '/3party/check', | 27 | '/3party/check', |
28 | '/3party/check/submit', | 28 | '/3party/check/submit', |
29 | - '/passport/imagesNode', | ||
30 | - '/passport/cert/headerTip', | ||
31 | '/passport/captcha/get', | 29 | '/passport/captcha/get', |
32 | - '/passport/images', | ||
33 | '/passport/img-check.jpg', | 30 | '/passport/img-check.jpg', |
34 | '/passport/geetest/register', | 31 | '/passport/geetest/register', |
35 | - '/activity/individuation/productLst', | 32 | + '/activity/individuation', |
36 | '/activity/individuation/coupon', | 33 | '/activity/individuation/coupon', |
37 | '/activity/share', | 34 | '/activity/share', |
38 | '/activity/wechat/share', | 35 | '/activity/wechat/share', |
39 | '/activity/wechat/1111', | 36 | '/activity/wechat/1111', |
40 | '/api/switch', | 37 | '/api/switch', |
41 | '/passport/login/user', | 38 | '/passport/login/user', |
42 | - '/api/sw.js', | ||
43 | - '/api/manifest.json', | ||
44 | - '/api/activity/sw.js', | ||
45 | - '/api/activity/manifest.json', | ||
46 | - '/api/hfxRaNY27L.txt', | ||
47 | - '/api/activity/hfxRaNY27L.txt', | ||
48 | - '/api/shop/hfxRaNY27L.txt', | ||
49 | - '/api/product/hfxRaNY27L.txt', | ||
50 | - '/api/.well-known/apple-app-site-association', | ||
51 | - '/sitemap.xml' | 39 | + '/sw.js', |
40 | + '/manifest.json', | ||
41 | + '/activity/sw.js', | ||
42 | + '/activity/manifest.json', | ||
43 | + '/hfxRaNY27L.txt', | ||
44 | + '/activity/hfxRaNY27L.txt', | ||
45 | + '/product/shop/hfxRaNY27L.txt', | ||
46 | + '/product/hfxRaNY27L.txt', | ||
47 | + '/.well-known/apple-app-site-association', | ||
48 | + '/service/sitemap.xml' | ||
52 | ]; | 49 | ]; |
53 | 50 | ||
54 | const limiter = (rule, policy, context) => { | 51 | const limiter = (rule, policy, context) => { |
@@ -59,7 +59,7 @@ module.exports = () => { | @@ -59,7 +59,7 @@ module.exports = () => { | ||
59 | req.url = `/product/search${req.path}`; | 59 | req.url = `/product/search${req.path}`; |
60 | } | 60 | } |
61 | 61 | ||
62 | - if (/^\/(list|shop)/.test(req.url) && req.url.indexOf('hfxRaNY27L') < 0) { | 62 | + if (/^\/(list|shop)/.test(req.url)) { |
63 | // 商品列表页、全球购商品列表页、店铺首页路由 | 63 | // 商品列表页、全球购商品列表页、店铺首页路由 |
64 | req.url = `/product${req.url}`; | 64 | req.url = `/product${req.url}`; |
65 | } | 65 | } |
public/static/OFRuhJ43rY.txt
0 → 100644
1 | +84e2e0416b10c7872b4983ad2c63892e |
1 | User-Agent: * | 1 | User-Agent: * |
2 | -Disallow: /passport | ||
3 | -Disallow: /cart | 2 | + |
3 | +Disallow: /passport/ | ||
4 | +Disallow: /cart/ | ||
4 | Disallow: /home/ | 5 | Disallow: /home/ |
5 | Disallow: /service/ | 6 | Disallow: /service/ |
6 | -Disallow: /3party | ||
7 | -Disallow: /api | ||
8 | -Disallow: /hf | ||
9 | -Disallow: /rn | ||
10 | -Sitemap: https://m.yohobuy.com/sitemap.xml | ||
7 | +Disallow: /3party/ | ||
8 | +Disallow: /api/ | ||
9 | +Disallow: /hf/ | ||
10 | +Disallow: /rn/ | ||
11 | +Disallow: /*?* | ||
12 | +Disallow: /coupon/ | ||
13 | +Disallow: /brands/search/ | ||
14 | +Disallow: /activity/ | ||
15 | +Disallow: /product/detail/ | ||
16 | +Disallow: /reg.html | ||
17 | +Disallow: /signin.html | ||
18 | +Disallow: /search/ |
-
Please register or login to post a comment