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
ccbikai(👎🏻🍜)
9 years ago
Commit
3358adcc90922fbe4167029b5cbfba8bdc9584d3
1 parent
0a9a09e9
URL 重写优化
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
doraemon/middleware/sub-domain.js
doraemon/middleware/sub-domain.js
View file @
3358adc
...
...
@@ -16,12 +16,16 @@ module.exports = () => {
req
.
url
=
`
/
guang$
{
req
.
url
}
`
;
break
;
case
'list'
:
// list
req
.
url
=
`
/
product
/
index
/
index
?
$
{
querystring
.
stringify
(
req
.
query
)}
`
;
if
(
req
.
path
===
'/'
)
{
req
.
url
=
`
/
product
/
index
/
index
?
$
{
querystring
.
stringify
(
req
.
query
)}
`
;
}
break
;
case
'search'
:
// search
req
.
url
=
`
/
product
/
search
/
list
?
$
{
querystring
.
stringify
(
req
.
query
)}
`
;
if
(
req
.
path
===
'/'
)
{
req
.
url
=
`
/
product
/
search
/
list
?
$
{
querystring
.
stringify
(
req
.
query
)}
`
;
}
break
;
case
'sale'
:
// sale
case
'sale'
:
// sale
跳转到 m.yohobuy.com/product/sale
res
.
redirect
(
301
,
helpers
.
urlFormat
(
'/product/sale'
,
req
.
query
,
'default'
));
return
;
case
'new'
:
// new.m.yohobuy.com 全部跳转到 m.yohobuy.com
...
...
Please
register
or
login
to post a comment