...
|
...
|
@@ -6,8 +6,23 @@ exports.index = function(req, res, next) { |
|
|
let qcdn = _.get(req.app.locals, 'wap.qcloud_cdn');
|
|
|
const { page = 1 } = req.query || {};
|
|
|
|
|
|
let app = req.query.app || {};
|
|
|
let app_session_key = app.session_key;
|
|
|
let uid = '';
|
|
|
|
|
|
if (typeof req.user.uid !== 'undefined') {
|
|
|
uid = {
|
|
|
toString: () => {
|
|
|
return _.parseInt(req.user.uid);
|
|
|
},
|
|
|
sessionKey: app_session_key
|
|
|
};
|
|
|
} else {
|
|
|
uid = '';
|
|
|
}
|
|
|
|
|
|
req.ctx(FindGoods)
|
|
|
.findGoods({ page })
|
|
|
.findGoods({ page, uid })
|
|
|
.then(result => {
|
|
|
if (!result) {
|
|
|
return next();
|
...
|
...
|
@@ -49,8 +64,23 @@ exports.index = function(req, res, next) { |
|
|
exports.fetchMore = function(req, res, next) {
|
|
|
const { page = 1 } = req.query || {};
|
|
|
|
|
|
let app = req.query.app || {};
|
|
|
let app_session_key = app.session_key;
|
|
|
let uid = '';
|
|
|
|
|
|
if (typeof req.user.uid !== 'undefined') {
|
|
|
uid = {
|
|
|
toString: () => {
|
|
|
return _.parseInt(req.user.uid);
|
|
|
},
|
|
|
sessionKey: app_session_key
|
|
|
};
|
|
|
} else {
|
|
|
uid = '';
|
|
|
}
|
|
|
|
|
|
req.ctx(FindGoods)
|
|
|
.findGoods({ page })
|
|
|
.findGoods({ page, uid })
|
|
|
.then(result => {
|
|
|
if (!result) {
|
|
|
return next();
|
...
|
...
|
|