Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
陈峰
7 years ago
Commit
e58b6ede09c56c7f1b96191651972c1970ef9528
1 parent
f70a6081
fix shop to mobile
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
doraemon/middleware/mobile-check.js
doraemon/middleware/mobile-check.js
View file @
e58b6ed
...
...
@@ -13,8 +13,13 @@ module.exports = () => {
if
(
req
.
noRefer
)
{
res
.
locals
.
mobileRefer
=
''
;
}
else
if
(
req
.
isMobile
)
{
const
redirect
=
`
//m.yohobuy.com${req.url}?${querystring.stringify(req.query || {})}`;
if
(
req
.
shopRedirect
)
{
return
res
.
redirect
(
redirect
);
}
return
res
.
redirect
(
req
.
mobileUrl
||
res
.
locals
.
mobileRefer
||
`
//m.yohobuy.com${req.url}?${querystring.stringify(req.query)}`
);
redirect
);
}
return
next
();
...
...
Please
register
or
login
to post a comment