Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
徐炜
9 years ago
Commit
9912fddde31b4e7210b468a03ec573be3da02f63
1 parent
7e2c303f
微信分享不跳转到特殊页面
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
doraemon/middleware/mobile-check.js
doraemon/middleware/mobile-check.js
View file @
9912fdd
...
...
@@ -11,13 +11,16 @@ module.exports = () => {
let
isMobile
=
/
(
nokia|iphone|android|ipad|motorola|^mot
\-
|softbank|foma|docomo|kddi|up
\.
browser|up
\.
link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam
\-
|s
[
cg
]
h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte
\-
|longcos|pantech|gionee|^sie
\-
|portalmmm|jig
\s
browser|hiptop|^ucweb|^benq|haier|^lct|opera
\s
*mobi|opera
\*
mini|320x320|240x320|176x220
)
/i
.
test
(
req
.
get
(
'user-agent'
));
// eslint-disable-line
let
isWechat
=
/
(
MicroMessenger
)
/i
.
test
(
req
.
get
(
'user-agent'
));
// eslint-disable-line
if
(
isWechat
)
{
// 微信不跳转
return
res
.
redirect
(
`
//m.yohoblk.com${req.url}`);
}
if
(
isMobile
)
{
// http://jira.yoho.cn:8888/browse/BLK-2051
if
(
req
.
url
===
'/'
)
{
return
res
.
redirect
(
'//www.yohoshow.com/about/index/blkqr'
);
}
if
(
isMobile
)
{
// http://jira.yoho.cn:8888/browse/BLK-2051
return
res
.
redirect
(
`
//m.yohoblk.com${req.url}`);
}
next
();
};
};
...
...
Please
register
or
login
to post a comment