config.prodDev.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. // 路由设置
  82. config.routePrefix = '/dev/point/v1/api';
  83. // 支付路由回调设置
  84. config.payReturn = {
  85. order: '/dev/point/v1/api/pay/order',
  86. };
  87. // http请求前缀
  88. config.httpPrefix = {
  89. // wechat: 'http://127.0.0.1:14001/wechat/api',
  90. wechat: 'https://broadcast.waityou24.cn/wechat/api',
  91. // email: 'http://broadcast.waityou24.cn/semail/api',
  92. email: 'http://127.0.0.1:14002/semail/api',
  93. sms: 'http://127.0.0.1:14003/sms/api',
  94. };
  95. config.emailConfig = {
  96. config: 'free',
  97. };
  98. config.smsConfig = {
  99. config: 'free',
  100. };
  101. // 中间件
  102. config.requestLog = {
  103. toMongoDB: true,
  104. };
  105. config.redisKey = {
  106. orderKeyPrefix: 'orderKey:',
  107. };
  108. config.redisTimeout = 3600;
  109. config.errcode = {
  110. groupJoinRefund: -111,
  111. };
  112. config.wxPayConfig = 'pointApp';
  113. return {
  114. ...config,
  115. ...userConfig,
  116. };
  117. };