1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- 'use strict';
- /**
- * @param {Egg.Application} app - egg application
- */
- const os = require('os');
- function getIPAdress() {
- const interfaces = os.networkInterfaces();
- for (const devName in interfaces) {
- const iface = interfaces[devName];
- for (let i = 0; i < iface.length; i++) {
- const alias = iface[i];
- if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal) {
- return alias.address;
- }
- }
- }
- }
- module.exports = app => {
- const { router, controller } = app;
- const { routePrefix, cluster } = app.config;
- const ipAddress = getIPAdress();
- console.log(`前缀:http://${ipAddress}:${cluster.listen.port}${routePrefix}`);
- router.get(`${routePrefix}`, controller.home.index);
- router.get(`${routePrefix}/util/getConfig`, controller.util.getConfig);
- // user
- console.log('user');
- require('./z_router/user/admin')(app); // 管理员
- require('./z_router/user/expert')(app); // 专家
- require('./z_router/user/inviteCode')(app); // 邀请码
- require('./z_router/user/mechanism')(app); // 机构
- require('./z_router/user/organization')(app); // 机构(o)
- require('./z_router/user/personal')(app); // 个人账号
- require('./z_router/user/personChat')(app); // 聊天消息
- require('./z_router/user/personRoom')(app); // 聊天室
- // channel
- console.log('channel');
- require('./z_router/channel/channel')(app); // 科技频道
- require('./z_router/channel/channelVideo')(app); // 科技频道视频
- // consultation
- console.log('consultation');
- require('./z_router/consultation/trainLive')(app); // 培训问诊
- require('./z_router/consultation/trainChat')(app); // 培训问诊聊天
- require('./z_router/consultation/trainVideo')(app); // 培训问诊视频表
- require('./z_router/consultation/trainUser')(app); // 培训问诊用户
- // cysci
- console.log('cysci');
- require('./z_router/cysci/cashing')(app); // 高企申报兑换
- require('./z_router/cysci/coupons')(app); // 创新券
- require('./z_router/cysci/couponsApply')(app); // 创新券申领
- require('./z_router/cysci/declare')(app); // 高企申报
- require('./z_router/cysci/reward')(app); // 研发补贴,奖励兑换申领
- // dock
- console.log('dock');
- require('./z_router/dock/dock')(app); // 展会
- require('./z_router/dock/dockChat')(app); // 展会公共聊天
- require('./z_router/dock/dockImgtxt')(app); // 展会图文
- require('./z_router/dock/dockTranscation')(app); // 展会合同备份
- require('./z_router/dock/dockUser')(app); // 展会用户
- require('./z_router/dock/dockVideo')(app); // 展会视频
- // kjzl
- console.log('kjzl');
- require('./z_router/kjzl/kjzlMedium')(app); // 科教之旅-机构
- require('./z_router/kjzl/kjzlOrder')(app); // 科教之旅-订单
- // news
- console.log('news');
- require('./z_router/news/column')(app); // 栏目
- require('./z_router/news/interview')(app); // 嘉宾访谈
- require('./z_router/news/news')(app); // 信息
- require('./z_router/news/notice')(app); // 通知管理
- require('./z_router/news/product')(app); // 产品
- require('./z_router/news/projectSolic')(app); // 项目征集
- require('./z_router/news/question')(app); // 调研考察
- require('./z_router/news/roadShow')(app); // 项目路演
- require('./z_router/news/science')(app); // 科技新闻
- require('./z_router/news/survey')(app); // 建言献策,网上调查
- require('./z_router/news/universal')(app); // 科学普及
- require('./z_router/news/viewPoint')(app); // 智库视点
- // system
- console.log('system');
- require('./z_router/system/category')(app); // 字典分类
- require('./z_router/system/code')(app); // 字典
- require('./z_router/system/menu')(app); // 菜单
- require('./z_router/system/role')(app); // 角色
- // statistics
- console.log('statistics');
- require('./z_router/statistics/index')(app); // 统计
- // patent
- };
|