Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
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
郭成尧
9 years ago
Commit
0a9a09e9d7d9fd1cfa6904422e5f0bff63812b09
1 parent
5ef21d1a
sub-domain
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
doraemon/middleware/sub-domain.js
doraemon/middleware/sub-domain.js
View file @
0a9a09e
...
...
@@ -9,7 +9,6 @@ const helpers = global.yoho.helpers;
module
.
exports
=
()
=>
{
return
(
req
,
res
,
next
)
=>
{
console
.
log
();
if
(
req
.
subdomains
.
length
)
{
switch
(
req
.
subdomains
[
0
])
{
case
'guang'
:
// 逛
...
...
@@ -24,7 +23,7 @@ module.exports = () => {
break
;
case
'sale'
:
// sale
res
.
redirect
(
301
,
helpers
.
urlFormat
(
'/product/sale'
,
req
.
query
,
'default'
));
return
;
return
;
case
'new'
:
// new.m.yohobuy.com 全部跳转到 m.yohobuy.com
res
.
redirect
(
301
,
helpers
.
urlFormat
(
req
.
path
,
req
.
query
,
'default'
));
return
;
...
...
@@ -38,4 +37,4 @@ module.exports = () => {
}
next
();
};
};
\ No newline at end of file
};
...
...
Please
register
or
login
to post a comment