router.js 897 Bytes
/**
 * 管理员router
 * @author: leo <qi.li@yoho.cn>
 * @date: 23/06/2017
 */
const express = require('express');
const router = express.Router();  // eslint-disable-line
const admin = require('./controllers/admin');

router.get('/login', admin.loginPage);
router.get('/home', admin.homePage);

// 活动管理
router.get('/activity/list', admin.activityListPage);
router.get('/activity/create', admin.createActivityPage);
router.get('/activity/user', admin.activityUserListPage);
router.get('/activity/article', admin.actArticleListPage);

// ajax
router.post('/api/login', admin.login);
router.post('/api/logout', admin.logout);
router.post('/api/activity/list', admin.activityList);
router.post('/api/activity/create', admin.createActivity);
router.post('/api/activity/delete', admin.deleteActivity);
router.post('/api/activity/deleteArticle', admin.deleteArticle);

module.exports = router;