|
@@ -7,7 +7,6 @@ |
|
@@ -7,7 +7,6 @@ |
7
|
'use strict';
|
7
|
'use strict';
|
8
|
|
8
|
|
9
|
const _ = require('lodash');
|
9
|
const _ = require('lodash');
|
10
|
-const cookie = global.yoho.cookie;
|
|
|
11
|
const camelCase = global.yoho.camelCase;
|
10
|
const camelCase = global.yoho.camelCase;
|
12
|
const config = global.yoho.config;
|
11
|
const config = global.yoho.config;
|
13
|
const mcHandler = require('../models/menu-crumb-handler');
|
12
|
const mcHandler = require('../models/menu-crumb-handler');
|
|
@@ -18,7 +17,7 @@ const favorite = { |
|
@@ -18,7 +17,7 @@ const favorite = { |
18
|
goods(req, res, next) {
|
17
|
goods(req, res, next) {
|
19
|
let q = req.query;
|
18
|
let q = req.query;
|
20
|
let page = parseInt(q.page || 1, 10);
|
19
|
let page = parseInt(q.page || 1, 10);
|
21
|
- let uid = cookie.getUid(req);
|
20
|
+ let uid = req.user.uid;
|
22
|
let sort = q.sort ? parseInt(q.sort, 10) : '';
|
21
|
let sort = q.sort ? parseInt(q.sort, 10) : '';
|
23
|
let ret = {
|
22
|
let ret = {
|
24
|
module: 'me',
|
23
|
module: 'me',
|
|
@@ -97,7 +96,7 @@ const favorite = { |
|
@@ -97,7 +96,7 @@ const favorite = { |
97
|
brand(req, res, next) {
|
96
|
brand(req, res, next) {
|
98
|
let q = req.query;
|
97
|
let q = req.query;
|
99
|
let page = parseInt(q.page || 1, 10);
|
98
|
let page = parseInt(q.page || 1, 10);
|
100
|
- let uid = cookie.getUid(req);
|
99
|
+ let uid = req.user.uid;
|
101
|
let limit = 5;
|
100
|
let limit = 5;
|
102
|
let ret = {
|
101
|
let ret = {
|
103
|
module: 'me',
|
102
|
module: 'me',
|
|
@@ -159,7 +158,7 @@ const favorite = { |
|
@@ -159,7 +158,7 @@ const favorite = { |
159
|
editorial(req, res, next) {
|
158
|
editorial(req, res, next) {
|
160
|
let q = req.query;
|
159
|
let q = req.query;
|
161
|
let page = parseInt(q.page || 1, 10);
|
160
|
let page = parseInt(q.page || 1, 10);
|
162
|
- let uid = cookie.getUid(req);
|
161
|
+ let uid = req.user.uid;
|
163
|
let limit = 5;
|
162
|
let limit = 5;
|
164
|
let ret = {
|
163
|
let ret = {
|
165
|
module: 'me',
|
164
|
module: 'me',
|
|
@@ -209,7 +208,7 @@ const favorite = { |
|
@@ -209,7 +208,7 @@ const favorite = { |
209
|
cancel(req, res, next) {
|
208
|
cancel(req, res, next) {
|
210
|
let type = req.body.type;
|
209
|
let type = req.body.type;
|
211
|
let ids = req.body.ids;
|
210
|
let ids = req.body.ids;
|
212
|
- let uid = cookie.getUid(req);
|
211
|
+ let uid = req.user.uid;
|
213
|
|
212
|
|
214
|
FavoriteData.cancelFavorite(uid, ids, type).then(result => {
|
213
|
FavoriteData.cancelFavorite(uid, ids, type).then(result => {
|
215
|
if (result && result.code === 200) {
|
214
|
if (result && result.code === 200) {
|
|
@@ -223,7 +222,7 @@ const favorite = { |
|
@@ -223,7 +222,7 @@ const favorite = { |
223
|
// 取消资讯收藏
|
222
|
// 取消资讯收藏
|
224
|
editorialCancel(req, res, next) {
|
223
|
editorialCancel(req, res, next) {
|
225
|
let ids = req.body.ids;
|
224
|
let ids = req.body.ids;
|
226
|
- let uid = cookie.getUid(req);
|
225
|
+ let uid = req.user.uid;
|
227
|
|
226
|
|
228
|
FavoriteData.cancelEditorialFavorite(uid, ids).then(result => {
|
227
|
FavoriteData.cancelEditorialFavorite(uid, ids).then(result => {
|
229
|
if (result && result.code === 200) {
|
228
|
if (result && result.code === 200) {
|