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
0c42c4e7c08aba5177b56a37dd4bc332e25b6cbe
1 parent
4a2ec178
subDomain增加new转发跳转
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
doraemon/middleware/sub-domain.js
doraemon/middleware/sub-domain.js
View file @
0c42c4e
...
...
@@ -5,13 +5,19 @@
*/
'use strict'
;
const
helpers
=
global
.
yoho
.
helpers
;
module
.
exports
=
()
=>
{
return
(
req
,
res
,
next
)
=>
{
console
.
log
(
req
.
subdomains
)
if
(
req
.
subdomains
.
length
)
{
switch
(
req
.
subdomains
[
0
])
{
case
'guang'
:
// 逛
req
.
url
=
req
.
url
.
replace
(
'/guang'
,
''
);
req
.
url
=
`
/
guang$
{
req
.
url
}
`
;
break
;
case
'new'
:
res
.
redirect
(
helpers
.
urlFormat
(
req
.
path
,
req
.
query
,
'default'
));
return
;
default
:
// 其它(识别为品牌)
req
.
url
=
`
/
product
/
brand
/
$
{
req
.
subdomains
[
0
]}
`
;
break
;
...
...
Please
register
or
login
to post a comment