123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- /* 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.msgEx = 't_m_dev';
- // 路由设置
- 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',
- chat: 'http://127.0.0.1:12214/dev/point/chat/v1/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,
- };
- };
|