...
|
...
|
@@ -38,9 +38,10 @@ module.exports = () => { |
|
|
// 判断请求是否来自app
|
|
|
let userAgent = req.get('User-Agent');
|
|
|
|
|
|
yoho.isApp = /yh_blk/i.test(req.get('User-Agent'));
|
|
|
yoho.isApp = /yh_blk/i.test(req.get('User-Agent')) || /YH_BLK/i.test(req.get('User-Agent'));
|
|
|
yoho.isiOS = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(userAgent);
|
|
|
yoho.isAndroid = /Android/i.test(userAgent);
|
|
|
yoho.isYohoBuy = /YohoBuy/i.test(userAgent);
|
|
|
|
|
|
Object.assign(res.locals, yoho);
|
|
|
Object.assign(req.yoho, yoho);
|
...
|
...
|
|