Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
8 years ago
Commit
75e1a96d54911d223db3c8c05acd37a404f362a5
1 parent
8b7e7056
加入购物车判断是否返回shoppingkey
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
apps/shopping/controllers/cart.js
apps/shopping/controllers/cart.js
View file @
75e1a96
...
...
@@ -134,7 +134,13 @@ exports.addToCart = (req, res, next) => {
shoppingKey
:
req
.
cookies
.
_SPK
||
null
,
uid
:
req
.
user
.
uid
}).
then
((
result
)
=>
{
res
.
cookie
(
'_SPK'
,
result
.
data
.
shopping_key
,
{
maxAge
:
1000
*
60
*
60
*
24
*
365
,
httpOnly
:
true
,
path
:
'/'
});
if
(
result
.
data
&&
result
.
data
.
shopping_key
)
{
res
.
cookie
(
'_SPK'
,
result
.
data
.
shopping_key
,
{
maxAge
:
1000
*
60
*
60
*
24
*
365
,
httpOnly
:
true
,
path
:
'/'
}
);
}
res
.
json
(
result
);
}).
catch
(
next
);
};
...
...
Please
register
or
login
to post a comment