config.default.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 + '_1640765284662_2781';
  15. // add your middleware config here
  16. config.middleware = [ 'requestLog' ];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. // 日志
  22. config.logger = {
  23. level: 'DEBUG',
  24. allowDebugAtProd: true,
  25. };
  26. // mq设置
  27. config.amqp = {
  28. client: {
  29. hostname: '127.0.0.1',
  30. username: 'visit',
  31. password: 'visit',
  32. vhost: 'platform',
  33. },
  34. app: true,
  35. agent: true,
  36. };
  37. // 接收队列名称
  38. config.queue = 'platform/V1/server-user';
  39. // 发送队列名称
  40. config.sendQueue = {
  41. logs: 'freeAdmin/server-logs',
  42. };
  43. // http请求前缀
  44. config.httpPrefix = {
  45. logs: 'http://localhost:13002/freeAdminLog/api',
  46. };
  47. // redis设置
  48. // config.redis = {
  49. // client: {
  50. // port: 6379, // Redis port
  51. // host: '127.0.0.1', // Redis host
  52. // password: '123456',
  53. // db: 1,
  54. // },
  55. // };
  56. // 进程设置
  57. config.cluster = {
  58. listen: {
  59. port: 9301,
  60. },
  61. };
  62. // jwt设置
  63. config.jwt = {
  64. ...jwt,
  65. expiresIn: '1d',
  66. issuer: 'platform-v1',
  67. };
  68. // 数据库设置
  69. config.dbName = 'platform-v1';
  70. config.mongoose = {
  71. url: `mongodb://101.36.221.66:27017/${config.dbName}`,
  72. options: {
  73. user: 'admin',
  74. pass: 'admin',
  75. authSource: 'admin',
  76. useNewUrlParser: true,
  77. useCreateIndex: true,
  78. },
  79. };
  80. // 路由设置
  81. config.routePrefix = '/api/live/v1';
  82. // 中间件
  83. config.requestLog = {
  84. toMongoDB: true,
  85. };
  86. config.module = 'web';
  87. config.session = {
  88. maxAge: 1000 * 60 * 30, // 30=>30min
  89. renew: true,
  90. };
  91. config.export = {
  92. root_path: 'D:\\temp',
  93. export_path: 'D:\\temp\\export',
  94. export_dir: 'export',
  95. patentInfo_dir: 'patentInfo',
  96. domain: 'http://broadcast.waityou24.cn',
  97. };
  98. config.import = {
  99. root_path: 'D:\\temp',
  100. // root_path: 'D:\\free\\workspace\\server\\service-file\\upload',
  101. };
  102. config.project = {
  103. mission: 'http://127.0.0.1:4001',
  104. hnhmain: 'http://127.0.0.1:9201',
  105. };
  106. // 服务器发布路径
  107. config.baseUrl = 'http://broadcast.waityou24.cn';
  108. config.wxapi = {
  109. baseUrl: 'http://wx.cc-lotus.info', // 微信网关地址
  110. kjzl: {
  111. appid: 'wxcf1b5457939b0932',
  112. appSecret: 'f9a947c4a11f5304fc0bcabef98093d8',
  113. },
  114. jlstcompany: {
  115. appid: 'wx696d9dc3f5c25e42',
  116. appSecret: 'b794494632f448f56a6e722f57b42bc9',
  117. },
  118. jlstcoupons: {
  119. appid: 'wxc98fa7131638a37c',
  120. appSecret: 'f55f1734ee919a8e4eac64aea67f350a',
  121. },
  122. free: {
  123. appid: 'wxdf3ed83c095be97a',
  124. appSecret: 'd85dbe075c090cb12ce416bbda8e698c',
  125. },
  126. };
  127. return {
  128. ...config,
  129. ...userConfig,
  130. };
  131. };