Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
3f7548d67ee53f58680d9bbe6ec214fa5ea065fe
1 parent
face7e8e
body 增加 class
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
doraemon/middleware/set-yoho-data.js
doraemon/views/layout.hbs
doraemon/middleware/set-yoho-data.js
View file @
3f7548d
...
...
@@ -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
);
...
...
doraemon/views/layout.hbs
View file @
3f7548d
...
...
@@ -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
}}
...
...
Please
register
or
login
to post a comment