Authored by xuqi

get uid

@@ -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) {
@@ -10,8 +10,6 @@ @@ -10,8 +10,6 @@
10 10
11 const _ = require('lodash'); 11 const _ = require('lodash');
12 const camelCase = global.yoho.camelCase; 12 const camelCase = global.yoho.camelCase;
13 -  
14 -const cookie = global.yoho.cookie;  
15 const Search = require('../models/search'); 13 const Search = require('../models/search');
16 const DataHelper = require('../models/helpers'); 14 const DataHelper = require('../models/helpers');
17 const ShopData = require('../models/shop-service'); 15 const ShopData = require('../models/shop-service');
@@ -21,7 +19,7 @@ const shop = { @@ -21,7 +19,7 @@ const shop = {
21 // 店铺首页 19 // 店铺首页
22 index(req, res, next) { 20 index(req, res, next) {
23 let domain = req.params.domain; 21 let domain = req.params.domain;
24 - let uid = cookie.getUid(req); 22 + let uid = req.user.uid;
25 let data = { 23 let data = {
26 module: 'product', 24 module: 'product',
27 page: 'shop', 25 page: 'shop',
@@ -92,7 +90,7 @@ const shop = { @@ -92,7 +90,7 @@ const shop = {
92 let nav = [DataHelper.getChannelNav()]; 90 let nav = [DataHelper.getChannelNav()];
93 let domain = req.params.domain; 91 let domain = req.params.domain;
94 92
95 - let uid = cookie.getUid(req); 93 + let uid = req.user.uid;
96 let q = req.query; 94 let q = req.query;
97 95
98 q.order = q.order || 's_n_desc'; 96 q.order = q.order || 's_n_desc';