|
@@ -106,7 +106,8 @@ const favoriteBrand = (req, res, next) => { |
|
@@ -106,7 +106,8 @@ const favoriteBrand = (req, res, next) => { |
106
|
/* 判断参数是否有效 */
|
106
|
/* 判断参数是否有效 */
|
107
|
let id = req.body.id,
|
107
|
let id = req.body.id,
|
108
|
opt = req.body.opt || 'ok',
|
108
|
opt = req.body.opt || 'ok',
|
109
|
- uid = req.user.uid || (req.body.uid && parseInt(crypto.decrypt(null, req.body.uid))) || req.cookies.appUid;
|
109
|
+ uid = req.user.uid || (req.body.uid && parseInt(crypto.decrypt(null, req.body.uid))) || req.cookies.appUid,
|
|
|
110
|
+ isBrand = req.body.isBrand;
|
110
|
|
111
|
|
111
|
if (!stringProcess.isNumeric(id) || !stringProcess.isNumeric(uid)) {
|
112
|
if (!stringProcess.isNumeric(id) || !stringProcess.isNumeric(uid)) {
|
112
|
res.json(result);
|
113
|
res.json(result);
|
|
@@ -114,7 +115,7 @@ const favoriteBrand = (req, res, next) => { |
|
@@ -114,7 +115,7 @@ const favoriteBrand = (req, res, next) => { |
114
|
}
|
115
|
}
|
115
|
|
116
|
|
116
|
// 执行收藏或取消操作
|
117
|
// 执行收藏或取消操作
|
117
|
- return brandModel.favoriteBrand(uid, id, opt).then(data => {
|
118
|
+ return brandModel.favoriteBrand(uid, id, opt, isBrand).then(data => {
|
118
|
if (!data) {
|
119
|
if (!data) {
|
119
|
res.json({
|
120
|
res.json({
|
120
|
code: 400,
|
121
|
code: 400,
|