Authored by ccbikai(👎🏻🍜)

Merge branch 'gray' of git.yoho.cn:fe/yohobuywap-node into gray

... ... @@ -5,6 +5,7 @@
'use strict';
const mRoot = '../models';
const share = require(`${mRoot}/share`);
const _ = require('lodash');
exports.getShareContent = (req, res, next) => {
if (!req.query.shareId) {
... ... @@ -14,6 +15,13 @@ exports.getShareContent = (req, res, next) => {
});
}
if (!_.isNumber(+req.query.shareId)) {
return res.jsonp({
code: 400,
message: 'shareId is invalid'
});
}
share.getShareContent({
shareId: req.query.shareId
}).then(result => {
... ...
... ... @@ -19,7 +19,7 @@ const _activity = () => {
const _user = (params) => {
if (!params.uid) {
return {};
return Promise.resolve({});
}
return api.get('', {
method: 'app.passport.profile',
... ... @@ -387,6 +387,9 @@ const order = (params) => {
const getOrders = (params) => {
let finalResult = [];
if (!params.uid) {
return Promise.resolve({});
}
return _getOrderData(params).then(result => {
if (result.data && result.data.page_total && params.page <= result.data.page_total && result.data.order_list) {
let count = 0;
... ...
... ... @@ -3,17 +3,12 @@
*/
'use strict';
const serviceApi = global.yoho.ServiceAPI;
const _ = require('lodash');
/**
* 从接口获取 share 内容
* @returns {*|Promise.<TResult>}
*/
const getShareContent = (params) => {
if (!_.isNumber(params.shareId)) {
return Promise.resolve({});
}
return serviceApi.get('operations/api/v5/webshare/getShare', {
share_id: params.shareId
}).then(result => {
... ...