12345678910111213141516171819202122232425 |
- 'use strict';
- /**
- * [home的模块功能]
- * @author szjcomo
- * @createTime 2020-08-03
- * @param {[type]} app [description]
- * @return {[type]} [description]
- */
- module.exports = app => {
- // 管理员登录检查函数
- const managerLogin = app.middleware.managerLogin(app.config.jwt);
- // 需要授权的路由分组
- const authRouter = app.router.namespace(`/${process.env.APP_CUSTOME || 'universal'}/manager`, managerLogin);
- // 不需要授权的路由分组
- const notAuthRouter = app.router.namespace(`/${process.env.APP_CUSTOME || 'universal'}/admin`);
- // 用户登录
- notAuthRouter.post('/dologin', app.controller.manager.login.dologin);
- // 验证码图片
- notAuthRouter.get('/verify', app.controller.manager.login.verify);
- // 项目基本路由
- require('./base.js')(app, authRouter);
- // 加载项目路由
- require('./apps.js')(app, authRouter);
- };
|