router.js 1.47 KB
/**
 * 管理员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');
const activity = require('./controllers/activity');
const user = require('./controllers/user');

// 管理员[page]
router.get('/login', admin.loginPage);

// 活动管理[page]
router.get('/activity/list', activity.activityListPage);
router.get('/activity/create', activity.createActivityPage);
router.get('/activity/article', activity.actArticleListPage);

// 用户管理[page]
router.get('/user/list', user.userListPage);

// 用户登录日志[page]
router.get('/user/login-log', user.userLoginLog);
router.get('/user/exportUserLoginLog', user.exportUserLoginLog);


// 管理员[ajax]
router.post('/api/login', admin.login);
router.post('/api/logout', admin.logout);

// 活动管理[ajax]
router.post('/api/activity/list', activity.activityList);
router.post('/api/activity/create', activity.createActivity);
router.post('/api/activity/delete', activity.deleteActivity);
router.get('/api/activity/article', activity.actArticleList);
router.post('/api/activity/deleteArticle', activity.deleteArticle);
router.get('/api/activity/exportArticleList', activity.exportArticleList);

// 用户管理[ajax]
router.post('/api/user/delete', user.deleteUser);
router.get('/api/user/list', user.userList);
router.get('/api/user/exportUserList', user.exportUserList);

module.exports = router;