'use strict'; /** * @param {Egg.Application} app - egg application */ module.exports = app => { const { router, controller } = app; router.get('/', controller.home.index); // 取得用户权限列表 router.get('/api/auth/user/menus', controller.user.querymenus); router.get('/api/auth/user/finduserlist', controller.user.finduserlist); // 权限表设置路由 router.resources('role', '/api/auth/role', controller.role); // index、create、show、destroy router.post('role', '/api/auth/role/update/:id', controller.role.update); // 用户表设置路由 router.resources('user', '/api/auth/user', controller.user); // index、create、show、destroy router.post('user', '/api/auth/user/update/:id', controller.user.update); router.post('user', '/api/auth/user/uppasswd', controller.user.uppasswd); router.post('/api/auth/user/updatebyuid/:id', controller.user.updatebyuid); router.post('/api/auth/user/bind', controller.user.bind); // 查询业务管理员 router.get("/api/auth/businessuser", controller.user.businessuser); // 机构表设置路由 router.resources('dept', '/api/auth/dept', controller.dept); // index、create、show、destroy router.post('dept', '/api/auth/dept/update/:id', controller.dept.update); // 用户登录 router.post('/api/auth/login', controller.login.login); // 根据token取得用户信息 router.post('/api/auth/token', controller.login.token); // 用户退出登录 router.post('/api/auth/logout', controller.login.destroy); // 微信端访问地址 router.get('/api/auth/wxchat', controller.weixin.auth); // 微信登录 // 微信端访问地址 router.get('/api/auth/wxchattest', controller.weixin.authTest); // 微信登录测试 };