Authored by 毕凯

优化 App 判断

... ... @@ -79,7 +79,7 @@ const common = {
refer && !/signin|login|passport/.test(refer) && res.cookie('refer', encodeURI(refer), {
domain: 'yohobuy.com'
});
if (req.yoho.isApp) {
if (req.yoho.isApp || req.yoho.isMarsApp) {
return next({
code: 401,
message: 'weblogin',
... ...
... ... @@ -64,6 +64,10 @@ module.exports = () => {
yoho.isqq = /MQQBrowser/i.test(req.get('User-Agent') || '');
yoho.isMarsApp = /yohomars/i.test(req.get('User-Agent') || '');
if (yoho.isMarsApp) {
yoho.isApp = false;
}
Object.assign(res.locals, yoho);
Object.assign(req.yoho, yoho);
... ...