Authored by hongweigao

新人专享还原

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