Authored by 周少峰

check id

... ... @@ -7,6 +7,7 @@
'use strict';
const mRoot = '../models';
const helpers = global.yoho.helpers;
const studentsModel = require(`${mRoot}/students`); // students model
... ... @@ -77,6 +78,10 @@ exports.eduLevel = (req, res, next) => {
* @return {[type]} [description]
*/
exports.verify = (req, res, next) => {
req.user.uid= 13311991;
if (!req.user.uid) {
res.send({code: 200, data: helpers.urlFormat('/signin.html')});
}
studentsModel.verifyIdentity(req.user.uid, req.query).then(result => {
res.json(result);
... ...
... ... @@ -32,6 +32,15 @@ const getCoupon = (data) => {
/**
* 认证学生总数
* @params data array
* @return Object
*/
exports.studentsNum = (data) => {
return data;
};
/**
* 处理学生营销资源位数据
* @params data array 资源位接口返回数据
* @return object
... ...
... ... @@ -53,8 +53,11 @@ exports.getStudentsData = (channel) => {
realData: {
sortItem: [{title: '学生权益介绍', href: 'stu-rights'}, {title: '我要验证身份', href: 'stu-identity'},
{title: '学生热门单品', href: 'stu-good'}, {title: '更多活动推荐', href: 'stu-activity'}]
{title: '学生热门单品', href: 'stu-good'}, {title: '更多活动推荐', href: 'stu-activity'}],
identityItem: {
sendCoin: 100,
stuNum: []
}
},
footerTop: true
... ... @@ -65,9 +68,9 @@ exports.getStudentsData = (channel) => {
Object.assign(responseData.realData, stuHandler.studentResource(result[1].data));
}
// if (result[2].code === 200) {
// }
if (result[2].code === 200) {
responseData.realData.identityItem.stuNum = stuHandler.studentsNum(result[2].data);
}
if (result[3].code === 200) {
Object.assign(responseData.realData, {proItem: stuHandler.stuProducts(result[3].data.product_list)});
... ...