/* 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 + '_1664237342649_2194'; config.appName = '商城-服务'; // add your middleware config here config.middleware = [ 'errorEmail', 'setUserFromToken', 'checkLogin', 'checkUserRK' ]; // , 'checkLogin' // add your user config here const userConfig = { // myAppName: 'egg', }; config.checkToken = { enable: false, }; // 进程设置 config.cluster = { listen: { port: 12211, }, }; // 数据库设置 config.dbName = 'point_shopping-dev'; config.mongoose = { url: `mongodb://127.0.0.1:27017/${config.dbName}`, // 120.48.146.1 127.0.0.1 options: { user: 'admin', pass: 'admin', authSource: 'admin', useNewUrlParser: true, useCreateIndex: true, useFindAndModify: true, allowDiskUse: true, }, }; // jwt设置 config.jwt = { ...jwt, expiresIn: '1d', issuer: 'shopping', }; // redis设置 config.redis = { client: { port: 6379, // Redis port host: '127.0.0.1', // Redis host password: '123456', db: 2, }, }; // mq设置 config.amqp = { client: { hostname: '127.0.0.1', username: 'tehqDev', password: 'tehqDev', vhost: 'tehqDev', }, app: true, agent: true, }; // 定时任务机制设置 config.taskMqConfig = { ex: 'taskDev', queue: 'taskDev', routingKey: 'trDev', deadEx: 'deadTaskDev', deadQueue: 'deadTaskQueueDev', deadLetterRoutingKey: 'deadTrDev', }; // 路由设置 config.routePrefix = '/dev/point/v1/api'; // 支付路由回调设置 config.payReturn = { order: '/dev/point/v1/api/pay/order', }; // http请求前缀 config.httpPrefix = { // wechat: 'http://127.0.0.1:14001/wechat/api', wechat: 'https://broadcast.waityou24.cn/wechat/api', // email: 'http://broadcast.waityou24.cn/semail/api', email: 'http://127.0.0.1:14002/semail/api', sms: 'http://127.0.0.1:14003/sms/api', }; config.emailConfig = { config: 'free', }; config.smsConfig = { config: 'free', }; // 中间件 config.requestLog = { toMongoDB: true, }; config.redisKey = { orderKeyPrefix: 'orderKey:', }; config.redisTimeout = 3600; config.errcode = { groupJoinRefund: -111, }; config.wxPayConfig = 'pointApp'; return { ...config, ...userConfig, }; };