Authored by shuaiguo

Merge remote-tracking branch 'refs/remotes/origin/feature/magazine'

@@ -24,6 +24,10 @@ const indexModel = require('../models/index'); @@ -24,6 +24,10 @@ const indexModel = require('../models/index');
24 const index = async function(req, res, next) { 24 const index = async function(req, res, next) {
25 let {e_id, token = ''} = req.query; 25 let {e_id, token = ''} = req.query;
26 let isApp = req.yoho.isApp; 26 let isApp = req.yoho.isApp;
  27 + let userAgent = req.get('User-Agent');
  28 +
  29 + let isYohobuy = /yohobuy/i.test(userAgent);
  30 + let isMiniprogram = /miniprogram/i.test(userAgent);
27 31
28 /** 32 /**
29 * 用于渲染错误结果页面 33 * 用于渲染错误结果页面
@@ -47,7 +51,7 @@ const index = async function(req, res, next) { @@ -47,7 +51,7 @@ const index = async function(req, res, next) {
47 51
48 52
49 // 如果不在小程序或app中打开则返回 53 // 如果不在小程序或app中打开则返回
50 - if (!isApp) { 54 + if (!isApp || (!isYohobuy && !isMiniprogram)) {
51 return renderErroPage({msg: WRONG_INVIROMENT}); 55 return renderErroPage({msg: WRONG_INVIROMENT});
52 } 56 }
53 57