Authored by ccbikai

body 增加 class

... ... @@ -21,7 +21,11 @@ module.exports = () => {
yoho.channel = channel;
// 判断请求是否来自app
yoho.isApp = /yh_blk/i.test(req.get('Referer'));
let userAgent = req.get('User-Agent');
yoho.isApp = /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);
Object.assign(res.locals, yoho);
Object.assign(req.yoho, yoho);
... ...
... ... @@ -26,14 +26,11 @@
{{/unless}}
{{/if}}
</head>
<body {{#if isPassportPage}}class=passport-body{{/if}} {{#if isStarIndexPage}} class="star-index-bg"{{/if}} {{#if isStarDetailPage}}class="star-class-body"{{/if}}>
<body class="{{#if isApp}}app{{/if}} {{#if isiOS}}ios{{/if}} {{#if isAndroid}}android{{/if}}">
<div class="main-wrap">
{{{body}}}
</div>
{{#wechatShare}}
<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
{{/wechatShare}}
{{#if devEnv}}
<script src="//localhost:5004/libs.js"></script>
{{#unless noLocalJS}}
... ...