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
Email Patches
Plain Diff
Browse Files
Authored by
OF1706
8 years ago
Commit
566dcbb00bd8dba477287214beaafc59166b9b6d
1 parent
a51284af
cartAdd mini
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
apps/cart/controllers/cart.js
public/js/cart/cart-api.js
apps/cart/controllers/cart.js
View file @
566dcbb
...
...
@@ -229,7 +229,8 @@ const cartAdd = (req, res) => {
// 设置加入购物车凭证到客户端浏览器
if
(
!
shoppingKey
&&
result
&&
result
.
data
&&
result
.
data
.
shopping_key
)
{
res
.
cookie
(
'_SPK'
,
result
.
data
.
shopping_key
,
{
expires
:
new
Date
(
Date
.
now
()
+
86400
*
360
)
expires
:
new
Date
(
Date
.
now
()
+
86400
*
360
),
domain
:
config
.
cookieDomain
});
}
...
...
public/js/cart/cart-api.js
View file @
566dcbb
...
...
@@ -274,9 +274,11 @@ function addcart(data, cookieList) {
type
:
'POST'
,
url
:
'/cart/cart/add'
,
data
:
data
}).
then
(
function
(
d
)
{
if
(
d
.
code
===
200
)
{
// window.history.go(0);
refreshCart
(
d
.
data
);
if
(
cookieList
)
{
window
.
setCookie
(
'cart-del-list'
,
JSON
.
stringify
(
cookieList
),
{
...
...
Please
register
or
login
to post a comment