Authored by ccbikai(👎🏻🍜)

找回丢失的代码

... ... @@ -21,10 +21,16 @@ module.exports = () => {
// 判断请求是否来自app
yoho.isApp = req.query.app_version || req.query.appVersion;
yoho.isWechat = /micromessenger/i.test(req.get('User-Agent') || '');
Object.assign(res.locals, yoho);
Object.assign(req.yoho, yoho);
// App 内请求支持跨域
if (yoho.isApp) {
res.set('Access-Control-Allow-Origin', '*');
}
next();
};
};
... ...
... ... @@ -32,7 +32,7 @@
<link rel="apple-touch-startup-image" sizes="640x920" href="http://static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
</head>
<body class="{{#if width750}}width750{{/if}} {{#if isPassportPage}}passport-body{{/if}} {{#if isStarIndexPage}}star-index-bg{{/if}} {{#if isStarDetailPage}}star-class-body{{/if}} {{#if isInstallmentPage}}installment-body{{/if}}">
<body class="{{#if width750}}width750{{/if}} {{#if isWechat}}wechat-body{{/if}} {{#if isPassportPage}}passport-body{{/if}} {{#if isStarIndexPage}}star-index-bg{{/if}} {{#if isStarDetailPage}}star-class-body{{/if}} {{#if isInstallmentPage}}installment-body{{/if}}">
<div class="main-wrap">
{{#if systemUpdate}}
{{> updata}}
... ...