Authored by xuqi

get uid

... ... @@ -7,7 +7,6 @@
'use strict';
const _ = require('lodash');
const cookie = global.yoho.cookie;
const camelCase = global.yoho.camelCase;
const config = global.yoho.config;
const mcHandler = require('../models/menu-crumb-handler');
... ... @@ -18,7 +17,7 @@ const favorite = {
goods(req, res, next) {
let q = req.query;
let page = parseInt(q.page || 1, 10);
let uid = cookie.getUid(req);
let uid = req.user.uid;
let sort = q.sort ? parseInt(q.sort, 10) : '';
let ret = {
module: 'me',
... ... @@ -97,7 +96,7 @@ const favorite = {
brand(req, res, next) {
let q = req.query;
let page = parseInt(q.page || 1, 10);
let uid = cookie.getUid(req);
let uid = req.user.uid;
let limit = 5;
let ret = {
module: 'me',
... ... @@ -159,7 +158,7 @@ const favorite = {
editorial(req, res, next) {
let q = req.query;
let page = parseInt(q.page || 1, 10);
let uid = cookie.getUid(req);
let uid = req.user.uid;
let limit = 5;
let ret = {
module: 'me',
... ... @@ -209,7 +208,7 @@ const favorite = {
cancel(req, res, next) {
let type = req.body.type;
let ids = req.body.ids;
let uid = cookie.getUid(req);
let uid = req.user.uid;
FavoriteData.cancelFavorite(uid, ids, type).then(result => {
if (result && result.code === 200) {
... ... @@ -223,7 +222,7 @@ const favorite = {
// 取消资讯收藏
editorialCancel(req, res, next) {
let ids = req.body.ids;
let uid = cookie.getUid(req);
let uid = req.user.uid;
FavoriteData.cancelEditorialFavorite(uid, ids).then(result => {
if (result && result.code === 200) {
... ...
... ... @@ -10,8 +10,6 @@
const _ = require('lodash');
const camelCase = global.yoho.camelCase;
const cookie = global.yoho.cookie;
const Search = require('../models/search');
const DataHelper = require('../models/helpers');
const ShopData = require('../models/shop-service');
... ... @@ -21,7 +19,7 @@ const shop = {
// 店铺首页
index(req, res, next) {
let domain = req.params.domain;
let uid = cookie.getUid(req);
let uid = req.user.uid;
let data = {
module: 'product',
page: 'shop',
... ... @@ -92,7 +90,7 @@ const shop = {
let nav = [DataHelper.getChannelNav()];
let domain = req.params.domain;
let uid = cookie.getUid(req);
let uid = req.user.uid;
let q = req.query;
q.order = q.order || 's_n_desc';
... ...