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
周少峰
8 years ago
Commit
8576521a5bf2dfa815203ca4ef33556b82e4b2e6
2 parents
4aafd81f
e04487a9
Merge branch 'hotfix/detail'
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
apps/product/controllers/detail.js
apps/product/controllers/detail.js
View file @
8576521
...
...
@@ -14,6 +14,7 @@ const detailHelper = require(`${mRoot}/detail-helper`);
const
moment
=
require
(
'moment'
);
const
DEFAULT_AVATAR_ICO
=
'https://static.yohobuy.com/images/v3/boy.jpg'
;
const
_
=
require
(
'lodash'
);
const
qs
=
require
(
'querystring'
);
/**
* 首屏渲染商品详情
...
...
@@ -51,9 +52,11 @@ const showMainBack = (req, res) => {
return
service
.
showMainBackAsync
({
pid
:
pid
}).
then
((
result
)
=>
{
if
(
_
.
get
(
result
,
'data.product_skn'
))
{
res
.
redirect
(
301
,
helpers
.
getUrlBySkc
(
result
.
data
.
product_skn
));
let
query
=
!
_
.
isEmpty
(
req
.
query
)
?
`
?
$
{
qs
.
stringify
(
req
.
query
)}
`
:
''
;
res
.
redirect
(
301
,
`
$
{
helpers
.
getUrlBySkc
(
result
.
data
.
product_skn
)}
$
{
query
}
`
);
}
res
.
end
();
...
...
Please
register
or
login
to post a comment