Authored by htoooth

fix

... ... @@ -147,7 +147,7 @@ exports.editor = (req, res, next) => {
let pageSize = req.query.pageSize || 20;
Promise.all([
guangModel.getAuthor(authorId),
guangModel.getAuthor(channel, authorId),
guangModel.getArticleList(gender, null, uid, udid, page, '', authorId, pageSize, channel, true),
guangModel.getHotTags(1, 20, channel, isHotDegrade),
guangModel.getAds(channel, isAdDegrade),
... ... @@ -245,7 +245,7 @@ exports.detail = (req, res, next) => {
];
if (info.authorId) {
promises.push(guangModel.getAuthor(info.authorId));
promises.push(guangModel.getAuthor(channel, info.authorId));
} else {
promises.push({});
}
... ...
... ... @@ -478,7 +478,7 @@ const getRecoArticles = (gender, page, limit, channel) => {
/**
* 获取作者信息
*/
const getAuthor = authorId => {
const getAuthor = (channel, authorId) => {
return serviceApi.get('guang/service/v1/author/getAuthor', {
author_id: authorId
... ... @@ -493,7 +493,7 @@ const getAuthor = authorId => {
avatar: d.avatar,
name: d.name,
intro: d.author_desc,
authorUrl: d.name ? helpers.urlFormat('/Index/editor', {author_id: authorId }, 'guang') : ''
authorUrl: d.name ? urlHelper.editorUrl(channel, authorId) : ''
};
}
});
... ...
... ... @@ -193,7 +193,7 @@ module.exports = () => {
if (result.process) {
if (result.needRedirect) {
return res.redirect(result.url);
return res.redirect(301, result.url);
}
if (result.needNext) {
... ...