Authored by 沈志敏

fix bug

... ... @@ -47,7 +47,11 @@ 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}`;
articleData.colparam = {
urlpath: req.path,
param: `?id=${id}`
}
build.push(guangProcess.formatArticle(articleData, true, isApp, false, uid));
});
res.render('index/list', Object.assign({
... ...
... ... @@ -290,9 +290,12 @@ const getTagEditor = (param) => {
let infoList = result[0].data.list.artList;
infoList.forEach(val => {
val.reqPath = param.path;
val.colparam = {
urlpath: param.path,
param: ''
}
if (param.tag) {
val.reqPath = `${val.reqPath}?query=${param.tag}`;
val.colparam.param = `?query=${param.tag}`;
}
inf.push(guangProcess.formatArticle(val, true, param.isApp, true));
});
... ...
... ... @@ -80,13 +80,17 @@ const formatArticle = (articleData, showTag, isApp, showAuthor, uid, reqQueryStr
if (isApp) {
result.collect = {};
result.collect.isCollected = articleData.isFavor === true;
let originUrl = helpers.urlFormat(articleData.reqPath || '/author/index', null, 'guang'); // 跳转回的链接
let colparam = articleData.colparam || {
urlpath: '',
param: ''
}
let originUrl = helpers.urlFormat(colparam.urlpath || '/author/index', null, 'guang'); // 跳转回的链接
let collectUrl = 'javascript:;'; // 根据用户是否登录做处理的链接
if (!uid) {
let playUrlEncode = originUrl.replace(/\//g, '\\\/');
let playUrlEncode = `${originUrl}${colparam.param}`.replace(/\//g, '\\\/');
collectUrl = `${originUrl}?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:${playUrlEncode}","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}`;
collectUrl = `${originUrl}?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"${playUrlEncode}","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}`;
}
result.collect.url = collectUrl;
} else { // 点赞
... ...