config.prod.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. // 开发配置文件
  4. /**
  5. * @param {Egg.EggAppInfo} appInfo app info
  6. */
  7. const { jwt } = require('./config.secret');
  8. module.exports = appInfo => {
  9. /**
  10. * built-in config
  11. * @type {Egg.EggAppConfig}
  12. **/
  13. const config = (exports = {});
  14. // use for cookie sign key, should change to your own and keep security
  15. config.keys = appInfo.name + '_1664237342649_2194';
  16. config.appName = '天恩活泉商城-服务';
  17. // add your middleware config here
  18. config.middleware = [ 'errorEmail', 'setUserFromToken', 'checkLogin', 'checkUserRK' ]; // , 'checkLogin'
  19. // add your user config here
  20. const userConfig = {
  21. // myAppName: 'egg',
  22. };
  23. config.checkToken = {
  24. enable: false,
  25. };
  26. // 进程设置
  27. config.cluster = {
  28. listen: {
  29. port: 12211,
  30. },
  31. };
  32. // 数据库设置
  33. config.dbName = 'point_shopping-dev';
  34. config.mongoose = {
  35. url: `mongodb://127.0.0.1:27017/${config.dbName}`, // 120.48.146.1 127.0.0.1
  36. options: {
  37. user: 'admin',
  38. pass: 'admin',
  39. authSource: 'admin',
  40. useNewUrlParser: true,
  41. useCreateIndex: true,
  42. useFindAndModify: true,
  43. allowDiskUse: true,
  44. },
  45. };
  46. // jwt设置
  47. config.jwt = {
  48. ...jwt,
  49. expiresIn: '1d',
  50. issuer: 'shopping',
  51. };
  52. // redis设置
  53. config.redis = {
  54. client: {
  55. port: 6379, // Redis port
  56. host: '127.0.0.1', // Redis host
  57. password: '123456',
  58. db: 2,
  59. },
  60. };
  61. // mq设置
  62. config.amqp = {
  63. client: {
  64. hostname: '127.0.0.1',
  65. username: 'tehqDev',
  66. password: 'tehqDev',
  67. vhost: 'tehqDev',
  68. },
  69. app: true,
  70. agent: true,
  71. };
  72. // 定时任务机制设置
  73. config.taskMqConfig = {
  74. ex: 'taskDev',
  75. queue: 'taskDev',
  76. routingKey: 'trDev',
  77. deadEx: 'deadTaskDev',
  78. deadQueue: 'deadTaskQueueDev',
  79. deadLetterRoutingKey: 'deadTrDev',
  80. };
  81. config.msgEx = 't_m_dev';
  82. // 路由设置
  83. config.routePrefix = '/dev/point/v1/api';
  84. // 支付路由回调设置
  85. config.payReturn = {
  86. order: '/dev/point/v1/api/pay/order',
  87. };
  88. // http请求前缀
  89. config.httpPrefix = {
  90. // wechat: 'http://127.0.0.1:14001/wechat/api',
  91. wechat: 'https://broadcast.waityou24.cn/wechat/api',
  92. // email: 'http://broadcast.waityou24.cn/semail/api',
  93. email: 'http://127.0.0.1:14002/semail/api',
  94. sms: 'http://127.0.0.1:14003/sms/api',
  95. chat: 'http://127.0.0.1:12214/dev/point/chat/v1/api',
  96. };
  97. config.emailConfig = {
  98. config: 'free',
  99. };
  100. config.smsConfig = {
  101. config: 'free',
  102. };
  103. // 中间件
  104. config.requestLog = {
  105. toMongoDB: true,
  106. };
  107. config.redisKey = {
  108. orderKeyPrefix: 'orderKey:',
  109. };
  110. config.redisTimeout = 3600;
  111. config.errcode = {
  112. groupJoinRefund: -111,
  113. };
  114. config.wxPayConfig = 'pointApp';
  115. return {
  116. ...config,
  117. ...userConfig,
  118. };
  119. };