Showing
1 changed file
with
3 additions
and
1 deletions
@@ -102,10 +102,12 @@ app.use((req, res, next) => { | @@ -102,10 +102,12 @@ app.use((req, res, next) => { | ||
102 | req.app.locals.wap = app.locals.wap; // zookeper对象赋值 | 102 | req.app.locals.wap = app.locals.wap; // zookeper对象赋值 |
103 | 103 | ||
104 | // 判断请求是否来自app | 104 | // 判断请求是否来自app |
105 | + req.yoho.isMiniApp = /miniProgram/i.test(req.get('User-Agent') || ''); | ||
105 | req.yoho.isNowApp = /yohonow/i.test(req.get('User-Agent') || ''); | 106 | req.yoho.isNowApp = /yohonow/i.test(req.get('User-Agent') || ''); |
106 | req.yoho.isMarsApp = /yohomars/i.test(req.get('User-Agent') || ''); | 107 | req.yoho.isMarsApp = /yohomars/i.test(req.get('User-Agent') || ''); |
107 | req.yoho.isYohoApp = /YohoBuy/i.test(req.get('User-Agent') || ''); | 108 | req.yoho.isYohoApp = /YohoBuy/i.test(req.get('User-Agent') || ''); |
108 | - req.yoho.isApp = req.yoho.isMarsApp || | 109 | + req.yoho.isApp = req.yoho.isMiniApp || |
110 | + req.yoho.isMarsApp || | ||
109 | req.cookies.app_version || | 111 | req.cookies.app_version || |
110 | req.yoho.isNowApp || | 112 | req.yoho.isNowApp || |
111 | /YohoBuy/i.test(req.get('User-Agent') || '') || | 113 | /YohoBuy/i.test(req.get('User-Agent') || '') || |
-
Please register or login to post a comment