123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- /* 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: 15000,
- },
- };
- // jwt设置
- config.jwt = {
- ...jwt,
- expiresIn: '1d',
- issuer: 'new_court',
- };
- // 数据库设置
- config.dbName = 'court_v2';
- config.mongoose = {
- url: `mongodb://127.0.0.1:27017/${config.dbName}`,
- options: {
- user: 'admin',
- pass: 'admin',
- authSource: 'admin',
- useNewUrlParser: true,
- useCreateIndex: true,
- },
- };
- // 路由设置
- config.routePrefix = '/newCourt/v2/api';
- // 中间件
- config.requestLog = {
- toMongoDB: true,
- };
- return {
- ...config,
- ...userConfig,
- };
- };
|