Showing
3 changed files
with
25 additions
and
18 deletions
@@ -45,6 +45,8 @@ const annualAccount = require(`${cRoot}/annual-account`); | @@ -45,6 +45,8 @@ const annualAccount = require(`${cRoot}/annual-account`); | ||
45 | 45 | ||
46 | const shareBuy = require(`${cRoot}/share-buy`); | 46 | const shareBuy = require(`${cRoot}/share-buy`); |
47 | 47 | ||
48 | +const update = require('../../doraemon/middleware/update'); | ||
49 | + | ||
48 | // routers | 50 | // routers |
49 | 51 | ||
50 | router.get('/demo', demo.index); | 52 | router.get('/demo', demo.index); |
@@ -240,8 +242,8 @@ router.get('/app-downloads', appDownloads.index); | @@ -240,8 +242,8 @@ router.get('/app-downloads', appDownloads.index); | ||
240 | 242 | ||
241 | router.get('/couponSend', couponFloor.couponSend); // 获取优惠券 | 243 | router.get('/couponSend', couponFloor.couponSend); // 获取优惠券 |
242 | 244 | ||
243 | -router.get('/share-buy', shareBuy.index); // 分享购首页 | ||
244 | -router.get('/share-buy/detail', auth, shareBuy.detail); // 分享购详情页 | ||
245 | -router.get('/share-buy/my-rebeat', auth, shareBuy.myRebeat); // 我的返利 | 245 | +router.get('/share-buy', update, shareBuy.index); // 分享购首页 |
246 | +router.get('/share-buy/detail', auth, update, shareBuy.detail); // 分享购详情页 | ||
247 | +router.get('/share-buy/my-rebeat', auth, update, shareBuy.myRebeat); // 我的返利 | ||
246 | 248 | ||
247 | module.exports = router; | 249 | module.exports = router; |
doraemon/middleware/attestation.js
deleted
100644 → 0
doraemon/middleware/update.js
0 → 100644
1 | +/** | ||
2 | + * app版本判断 | ||
3 | + * @date: 2017/5/10 | ||
4 | + */ | ||
5 | +'use strict'; | ||
6 | + | ||
7 | +module.exports = (req, res, next) => { | ||
8 | + let versionArr, | ||
9 | + appVersion = req.yoho.isApp; | ||
10 | + | ||
11 | + if (appVersion) { | ||
12 | + versionArr = appVersion.split('.'); | ||
13 | + | ||
14 | + if (versionArr[0] < 5 || versionArr[1] < 7 || versionArr[1] < 1) { | ||
15 | + return res.redirect('http://m.yohobuy.com/passport/update?openby:yohobuy={"action":"go.h5","params":{"islogin":"N", "url":"http://m.yohobuy.com/passport/update"}}'); | ||
16 | + } | ||
17 | + } | ||
18 | + | ||
19 | + next(); | ||
20 | +}; |
-
Please register or login to post a comment