Authored by hongweigao

新人专享还原

... ... @@ -11,7 +11,7 @@ const _ = require('lodash');
const channelModel = require('../models/index');
exports.index = (req, res, next) => {
let channelType = req.path.split('/')[1] || 'boys';
let channelType = req.path.substring(1) || 'boys';
// 将woman转换为girls,以便model层进行处理
channelType === 'woman' ? channelType = 'girls' : null;
... ... @@ -96,7 +96,7 @@ exports.getIndexGuide = (req, res, next) => {
exports.hasNewUserFloor = (req, res, next) => {
channelModel.hasNewUserFloor(req.yoho.channel, req).then(data => {
channelModel.hasNewUserFloor(req.yoho.channel, req.user.uid).then(data => {
res.send(data);
}).catch(next);
};
... ...
... ... @@ -731,8 +731,6 @@ const _processFloorData = (rawData, type) => {
} else if (data && data.template_name === 'debrisSlider') { // 处理girls的banner
floorData = floorMap.debrisSlide.call(null, data.data);
} else if (data && data.template_name === 'jk_floor') { // 左1大图,右6小图,title
floorData = floorMap.jacket.call(null, data.data);
} else if (data.template_name === 'new_user_floor' || data.template_intro === '新人专享') {
if (!hasNewUser) {
floorData = floorMap.newuser.call(null, data.data);
... ... @@ -1250,8 +1248,8 @@ const getIndexGuideData = () => {
return serviceApi.get('operations/api/v6/category/getCategory', params, config.apiCache);
};
const hasNewUserFloor = (channelType, req) => {
let params = {uid: req.user.uid};
const hasNewUserFloor = (channelType, uid) => {
let params = {uid: uid};
return _requestContent(channelType, params).then(res => {
let isNewUser = false,
... ...