|
|
'use strict';
|
|
|
|
|
|
const shopModel = require('../models/shopCollect'),
|
|
|
headerModel = require('../../../doraemon/models/header');
|
|
|
headerModel = require('../../../doraemon/models/header'),
|
|
|
_ = require('lodash');
|
|
|
|
|
|
const crypto = global.yoho.crypto;
|
|
|
|
|
|
const shopIndex = (req, res) => {
|
|
|
let isApp = req.query.app_version || req.query.appVersion || false;
|
|
|
let uid = req.user.uid;
|
|
|
let uid = req.user.uid || req.query.uid;
|
|
|
let parameter = {};
|
|
|
|
|
|
if (!isApp) {
|
...
|
...
|
@@ -17,7 +18,7 @@ const shopIndex = (req, res) => { |
|
|
})
|
|
|
};
|
|
|
} else {
|
|
|
uid = crypto.encryption('', req.query.uid + '');
|
|
|
uid = crypto.encryption('', uid + '');
|
|
|
parameter = {
|
|
|
appVersion: true,
|
|
|
uid: uid
|
...
|
...
|
@@ -47,7 +48,7 @@ const shopNav = (req, res, next) => { |
|
|
|
|
|
|
|
|
const shopList = (req, res, next) => {
|
|
|
let uid = req.query.uid || req.user.uid || '';
|
|
|
let uid = req.query.uid ? _.trim(crypto.decrypt('', req.query.uid)) : req.user.uid;
|
|
|
let tabName = req.query.tabName;
|
|
|
|
|
|
shopModel.shopList(uid, tabName).then((result) => {
|
...
|
...
|
@@ -57,7 +58,7 @@ const shopList = (req, res, next) => { |
|
|
|
|
|
// 获取文章收藏状态
|
|
|
const shopFav = (req, res, next) => {
|
|
|
let uid = req.query.uid || req.user.uid || '';
|
|
|
let uid = req.query.uid ? _.trim(crypto.decrypt('', req.query.uid)) : req.user.uid;
|
|
|
let shopIds = req.query.shopIds;
|
|
|
|
|
|
shopModel.shopFav(uid, shopIds).then((result) => {
|
...
|
...
|
|