Authored by 郝肖肖

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

... ... @@ -87,7 +87,7 @@ let switchChannel = (req, res, next) => {
}
// 设置浏览器缓存5分钟 300000ms
res.set('Expires', (new Date(_.now() + 300000)).toGMTString());
// res.set('Expires', (new Date(_.now() + 300000)).toGMTString());
next();
};
... ...
... ... @@ -47,6 +47,7 @@ const editor = (req, res, next) => {
if (articleListData.data && articleListData.data.list && articleListData.data.list.artList) {
articleListData.data.list.artList.forEach(articleData => {
articleData.reqPath = `${req.path}?id=${id}`;
build.push(guangProcess.formatArticle(articleData, true, isApp, false, uid));
});
res.render('index/list', Object.assign({
... ... @@ -96,7 +97,7 @@ const pageData = (req, res, next) => {
isTab = req.query.isTab || false,
showAuthor = false;
let uid = req.user.uid,
let uid = req.user.uid || req.query.uid,
udid = req.sessionID;
if (!stringProcess.isNumeric(sortId)) {
... ... @@ -154,7 +155,7 @@ const index = (req, res, next) => {
};
let param = {
uid: req.user.uid,
uid: req.user.uid || req.query.uid,
udid: req.user.udid,
... ... @@ -192,13 +193,12 @@ const tag = (req, res, next) => {
tag: req.query.query,
isApp: req.query.app_version || req.query.appVersion || false,
gender: req.query.gender || '1,3',
uid: req.user.uid || 0,
uid: req.user.uid || req.query.uid || 0,
udid: req.sessionID,
type: req.query.type || 0
type: req.query.type || 0,
path: req.path
};
responseData.pageHeader.navTitle = param.tag || '标签';
... ... @@ -223,7 +223,7 @@ const listDynamicData = (req, res) => {
type = req.query.type;
if (req.user.uid) {
other.uid = req.user.uid;
other.uid = req.user.uid || req.query.uid;
}
if (query) {
... ... @@ -247,7 +247,7 @@ const listDynamicData = (req, res) => {
const detailDynamicData = (req, res) => {
let id = req.query.id,
uid = req.user.uid,
uid = req.user.uid || req.query.uid,
udid = req.sessionID;
indexModel.getDynamicDataById(id, uid, udid).then((ret) => {
... ...
... ... @@ -59,7 +59,7 @@ const collectArticle = (req, res, next) => {
/* 判断用户是否登录 */
let id = req.body.id,
opt = req.body.opt || 'ok',
uid = req.user.uid;
uid = req.body.uid;
if (!stringProcess.isNumeric(id) || !stringProcess.isNumeric(uid)) {
res.json(result);
... ... @@ -106,7 +106,7 @@ const favoriteBrand = (req, res, next) => {
/* 判断参数是否有效 */
let id = req.body.id,
opt = req.body.opt || 'ok',
uid = req.user.uid || (req.body.uid && parseInt(crypto.decrypt(null, req.body.uid))) || req.cookies.appUid,
uid = req.body.uid || req.cookies.appUid,
isBrand = req.body.isBrand;
if (!stringProcess.isNumeric(id) || !stringProcess.isNumeric(uid)) {
... ...
... ... @@ -290,7 +290,10 @@ const getTagEditor = (param) => {
let infoList = result[0].data.list.artList;
infoList.forEach(val => {
val.url = helpers.https(`${val.url}&openby:yohobuy={"action":"go.h5","params":{"param":{},"share":"","id":"","type":0,"islogin":"N","url":"${val.url}"}}`);
val.reqPath = param.path;
if (param.tag) {
val.reqPath = `${val.reqPath}?query=${param.tag}`;
}
inf.push(guangProcess.formatArticle(val, true, param.isApp, true));
});
... ...
... ... @@ -142,7 +142,7 @@ const index = (req, res, next) => {
}),
pageFooter: true,
search: {
defaultTerms: (result.defaultTerms.length !== 0) ? result.defaultTerms[0].content : '',
defaultTerms: (result.length && result.defaultTerms && result.defaultTerms.length !== 0) ? result.defaultTerms[0].content : '',
url: helpers.urlFormat('', null, 'search'),
hotTerms: result.hotTerms
}
... ...
... ... @@ -4,7 +4,7 @@
</a>
<div class="descripition">
{{shop_intro}}
{{{shop_intro}}}
</div>
<p class="sign-icon">
... ...
... ... @@ -427,10 +427,11 @@ seckillObj = {
};
$(function() {
seckillObj.init();
});
window.seckillRefresh = function() {
// location.reload();
};
$(function() {
seckillObj.init();
});
... ...
... ... @@ -80,7 +80,7 @@ const formatArticle = (articleData, showTag, isApp, showAuthor, uid, reqQueryStr
if (isApp) {
result.collect = {};
result.collect.isCollected = articleData.isFavor === true;
let originUrl = helpers.urlFormat('/author/index', null, 'guang'); // 跳转回的链接
let originUrl = helpers.urlFormat(articleData.reqPath || '/author/index', null, 'guang'); // 跳转回的链接
let collectUrl = 'javascript:;'; // 根据用户是否登录做处理的链接
if (!uid) {
... ...