Authored by 毕凯

增加星潮教室路由

... ... @@ -24,5 +24,5 @@ From: [eslint-config-yoho](https://www.npmjs.com/package/eslint-config-yoho)
- 拉取代码
- 安装全局包:`eslint`,`eslint-config-yoho`,`yo`,`generators-yohos`
- 安装本地依赖
- 启动服务进程:当前目录下运行`npm start`
- 启动 Web Server 服务进程:当前目录下运行`npm start`
- 进入模块的静态资源目录,运行`gulp`
... ...
... ... @@ -10,8 +10,14 @@ const routes = './routes';
var index = require(`${routes}/index`);
var wxLottery = require(`${routes}/wxLottery/index`);
var starClassroom = require(`${routes}/starClassroom`);
app.get('/', index.index); // 主页
app.get('/wxLottery', wxLottery.index); // 微信抽奖活动
app.get('/star/classroom', starClassroom.index); // 星潮教室主页
app.get('/star/classroom/check-in', starClassroom.checkIn); // 星潮教室签到
app.get('/star/classroom/subject', starClassroom.subject); // 星潮教室星专题
app.get('/star/classroom/collocation', starClassroom.collocation); // 星潮教室星搭配
module.exports = app;
... ...
/**
* 微信抽奖控制器
* @author: bikai
* @date: 2016/4/1
*/
// var lotteryModel = require('../../models/wxLottery/index');
// var errUtil = require('../../util/error');
// 星潮教室主页
exports.index = (req, res) => {
// 传入参数给lotteryModel发送到后端,获取返回的数据
// lotteryModel({test: 1}).then((data) => {
// // 接收接口返回到的数据,处理后,渲染页面或者返回 JSON
// res.send(data);
// }).catch((err) => {
// errUtil.webError(err, res); // 抓取 Promise 链的错误
// });
res.render('starClassroom/index', {
title: '星潮教室',
module: 'starClassroom',
version: '0.0.1'
// wxLottery: data
});
};
// 星潮教室签到
exports.checkIn = (req, res) => {
res.render('starClassroom/index', {
title: '星潮教室',
module: 'starClassroom',
version: '0.0.1'
// wxLottery: data
});
};
// 星潮教室星专题
exports.subject = (req, res) => {
res.render('starClassroom/subject', {
title: '星潮教室星专题',
module: 'starClassroom',
version: '0.0.1'
// wxLottery: data
});
};
// 星潮教室星搭配
exports.collocation = (req, res) => {
res.render('starClassroom/collocation', {
title: '星潮教室星搭配',
module: 'starClassroom',
version: '0.0.1'
// wxLottery: data
});
};
... ...