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
Plain Diff
Browse Files
Authored by
htoooth
8 years ago
Commit
b5f99ae771d52061fde31a0c6a4b3901e731465f
2 parents
4503d369
a2051f71
Merge remote-tracking branch 'origin/feature/seoUrl' into feature/seoUrl
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
apps/product/controllers/detail.js
apps/product/router.js
apps/product/controllers/detail.js
View file @
b5f99ae
...
...
@@ -296,7 +296,7 @@ const getPackage = (req, res, next) => {
};
const
redirectNewRouter
=
(
req
,
res
)
=>
{
return
res
.
redirect
(
301
,
helpers
.
urlFormat
(
`
/
p$
{
req
.
params
[
0
]}.
html$
{
req
.
params
[
2
]}
`
,
null
,
'item'
));
return
res
.
redirect
(
301
,
helpers
.
urlFormat
(
`
/
p$
{
req
.
params
[
0
]}.
html$
{
req
.
params
[
3
]}
`
,
null
,
'item'
));
};
module
.
exports
=
{
...
...
apps/product/router.js
View file @
b5f99ae
...
...
@@ -62,7 +62,7 @@ router.get('/outlets/:channel', outlets.channel); // 奥莱频道页
// 商品分类列表页
router
.
get
(
'/list'
,
outletsList
.
index
);
router
.
get
(
/
\/
pro_
([\d]
+
)
_
([\d]
+
)\/(
.*
)
/
,
detail
.
redirectNewRouter
);
// 老的商品详情routers
router
.
get
(
/
\/
pro_
([\d]
+
)
_
([\d]
+
)\/(
.*
)
.html
(
.*
)
/
,
detail
.
redirectNewRouter
);
// 老的商品详情routers
router
.
get
(
/
\/
p
([\d]
+
)(
.*
)
/
,
detail
.
showMain
);
// 新的商品详情routers
router
.
get
(
'/detail/comment'
,
detail
.
indexComment
);
// 商品评论
router
.
get
(
'/detail/consult'
,
detail
.
indexConsult
);
// 商品咨询
...
...
Please
register
or
login
to post a comment