You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
2.2 KiB
55 lines
2.2 KiB
const Card = require('../controllers/Card');
|
|
const Admin = require('../controllers/Admin');
|
|
const Notice = require('../controllers/Notice');
|
|
const Instruction = require('../controllers/Instruction');
|
|
const Img = require('../controllers/Img');
|
|
const File = require('../controllers/File');
|
|
|
|
module.exports = app => {
|
|
//退出登录
|
|
app.post('/logout', Card.logout);
|
|
|
|
//管理员
|
|
app.post('/admin/login', Admin.login);
|
|
app.post('/card/register', Admin.adminRequired, Card.upload, Card.register);
|
|
app.get('/card/getCode', Admin.adminRequired, Card.getCode);
|
|
app.get('/card/list', Admin.adminRequired, Card.cardList);
|
|
app.post('/card/delete', Admin.adminRequired, Card.deleteCard);
|
|
app.post('/admin/resetPassword', Admin.adminRequired, Card.resetPassword);
|
|
|
|
//用户
|
|
app.post('/card/login', Card.login);
|
|
app.post('/card/changePassword', Admin.loginRequired, Card.changePassword);
|
|
app.post('/card/shop', Admin.loginRequired, Card.shop);
|
|
|
|
//公共
|
|
app.get('/card/detail', Admin.loginRequired, Card.detail);
|
|
app.post('/card/update', Admin.loginRequired, Card.upload, Card.update);
|
|
app.post('/card/frozen', Admin.loginRequired, Card.frozen);
|
|
app.post('/card/recharge', Admin.loginRequired, Card.recharge);
|
|
app.post('/card/billList', Admin.loginRequired, Card.billList);
|
|
app.post('/card/beforeUpload', Admin.loginRequired, Card.beforeUpload);
|
|
|
|
//公告
|
|
app.post('/notice/new', Admin.adminRequired, Notice.new);
|
|
app.post('/notice/update', Admin.adminRequired, Notice.update);
|
|
app.get('/notice/detail', Notice.detail);
|
|
app.post('/notice/list', Notice.list);
|
|
app.post('/notice/delete', Admin.adminRequired, Notice.delete);
|
|
app.post('/notice/show', Admin.adminRequired, Notice.show);
|
|
|
|
//使用说明
|
|
app.post('/instruction/save', Admin.adminRequired, Instruction.save);
|
|
app.get('/instruction/detail', Instruction.detail);
|
|
|
|
//图片服务器代理
|
|
app.get('/imgs/*', Img.photo);
|
|
|
|
//文件
|
|
app.get('/file/fileList', File.fileFist);
|
|
app.post('/file/upload', Admin.adminRequired, File.upload);
|
|
app.post('/file/download', File.download);
|
|
app.post('/file/delete', Admin.adminRequired, File.delete);
|
|
|
|
};
|