/* eslint valid-jsdoc: "off" */ 'use strict'; /** * @param {Egg.EggAppInfo} appInfo app info */ const { jwt } = require('./config.secret'); module.exports = appInfo => { /** * built-in config * @type {Egg.EggAppConfig} **/ const config = (exports = {}); // use for cookie sign key, should change to your own and keep security config.keys = appInfo.name + '_1640765284662_2781'; // add your middleware config here config.middleware = [ 'requestLog' ]; // add your user config here const userConfig = { // myAppName: 'egg', }; // 日志 config.logger = { level: 'DEBUG', allowDebugAtProd: true, }; // mq设置 // config.amqp = { // client: { // hostname: '127.0.0.1', // username: 'freeAdmin', // password: '1qaz2wsx', // vhost: 'freeAdmin', // }, // app: true, // agent: true, // }; // 接收队列名称 // config.queue = 'freeAdmin/server-haocai-new'; // 发送队列名称 // config.sendQueue = { // logs: 'freeAdmin/server-logs', // }; // http请求前缀 config.httpPrefix = { // wechat: 'http://127.0.0.1:14001/wechat/api', wechat: 'https://broadcast.waityou24.cn/wechat/api', }; // 微信小程序消息模板 config.msgTemplate = { exit: { template_id: 'XC1Is016sqt09_3PsyySYKFtwdrLUqggdn5qIvOiSNI', data: [ { key: 'thing1', value: { value: '活动名称' } }, { key: 'thing2', value: { value: '项目名称' } }, { key: 'time3', value: { value: '申请时间' } }, { key: 'amount4', value: { value: '退款金额' } }, ], }, enroll: { template_id: 'HClmobxtn7b4qunUBF5a5y68cwak8d7VSwqGY0vAx1U', data: [ { key: 'thing1', value: { value: '比赛名称' } }, { key: 'thing4', value: { value: '赛事类型' } }, { key: 'thing5', value: { value: '参赛者姓名' } }, { key: 'thing8', value: { value: '报名审核结果' } }, { key: 'time2', value: { value: '报名时间' } }, ], }, remind: { template_id: 'cq3JPX9RMFdEGjH9dBn6n5P5CFCJJ9Q8LIljZlJgBlM', data: [ { key: 'thing1', value: { value: '比赛名称' } }, { key: 'thing2', value: { value: '比赛时间' } }, { key: 'thing4', value: { value: '赛制' } }, { key: 'thing7', value: { value: '比赛地点' } }, { key: 'thing8', value: { value: '参赛选手' } }, ], }, }; // redis设置 // config.redis = { // client: { // port: 6379, // Redis port // host: '127.0.0.1', // Redis host // password: '123456', // db: 0, // }, // }; // 进程设置 config.cluster = { listen: { port: 15001, }, }; // jwt设置 config.jwt = { ...jwt, expiresIn: '1d', issuer: 'new_court', }; // 数据库设置 config.dbName = 'court_race_v2'; config.baseDbName = 'court_v2'; config.defaultModule = 'Race'; config.mongoose = { clients: { base: { url: `mongodb://120.48.146.1:27017/${config.baseDbName}`, // 120.48.146.1 127.0.0.1 options: { user: 'admin', pass: 'admin', authSource: 'admin', useNewUrlParser: true, useCreateIndex: true, }, }, race: { url: `mongodb://120.48.146.1:27017/${config.dbName}`, // 120.48.146.1 127.0.0.1 options: { user: 'admin', pass: 'admin', authSource: 'admin', useNewUrlParser: true, useCreateIndex: true, }, }, }, }; // 路由设置 config.routePrefix = '/newCourt/race/v2/api'; // 中间件 config.requestLog = { toMongoDB: true, }; return { ...config, ...userConfig, }; };