config.default.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. /**
  4. * @param {Egg.EggAppInfo} appInfo app info
  5. */
  6. const { jwt } = require('./config.secret');
  7. module.exports = appInfo => {
  8. /**
  9. * built-in config
  10. * @type {Egg.EggAppConfig}
  11. **/
  12. const config = (exports = {});
  13. // use for cookie sign key, should change to your own and keep security
  14. config.keys = appInfo.name + '_1666686710616_3993';
  15. config.appName = '天恩活泉商城-服务';
  16. // add your middleware config here
  17. config.middleware = [ 'setUserFromToken' ];
  18. config.checkToken = {
  19. enable: false,
  20. };
  21. // 进程设置
  22. config.cluster = {
  23. listen: {
  24. port: 12212,
  25. },
  26. };
  27. // 数据库设置
  28. config.dbName = 'point_shopping-dev';
  29. config.mongoose = {
  30. url: `mongodb://120.48.146.1:27017/${config.dbName}`, // 120.48.146.1 127.0.0.1
  31. options: {
  32. user: 'admin',
  33. pass: 'admin',
  34. authSource: 'admin',
  35. useNewUrlParser: true,
  36. useCreateIndex: true,
  37. useFindAndModify: true,
  38. allowDiskUse: true,
  39. },
  40. };
  41. // redis设置
  42. config.redis = {
  43. client: {
  44. port: 6379, // Redis port
  45. host: '127.0.0.1', // Redis host
  46. password: '123456',
  47. db: 2,
  48. },
  49. };
  50. // mq设置
  51. config.amqp = {
  52. client: {
  53. hostname: 'broadcast.waityou24.cn',
  54. username: 'tehqDev',
  55. password: 'tehqDev',
  56. vhost: 'tehqDev',
  57. },
  58. app: true,
  59. agent: true,
  60. };
  61. // jwt设置
  62. config.jwt = {
  63. ...jwt,
  64. expiresIn: '1d',
  65. issuer: 'shopping',
  66. };
  67. // 路由设置
  68. config.routePrefix = '/dev/point/zr/v1/api';
  69. config.emailConfig = {
  70. config: 'free',
  71. };
  72. config.smsConfig = {
  73. config: 'free',
  74. };
  75. // 中间件
  76. config.requestLog = {
  77. toMongoDB: true,
  78. };
  79. config.redisKey = {
  80. orderKeyPrefix: 'zrOrderKey:',
  81. };
  82. config.redisTimeout = 3600;
  83. config.wxPayConfig = 'pointApp';
  84. // add your user config here
  85. const userConfig = {
  86. // myAppName: 'egg',
  87. };
  88. return {
  89. ...config,
  90. ...userConfig,
  91. };
  92. };