config.default.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. /**
  4. * @param {Egg.EggAppInfo} appInfo app info
  5. */
  6. const { jwt } = require('./config.secret');
  7. const WechatAPI = require('co-wechat-api');
  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 + '_1629889590707_2425';
  16. // add your middleware config here
  17. config.middleware = [ 'tokenCheck', 'killColumns', 'operaLogs' ];
  18. // add your user config here
  19. const userConfig = {
  20. // myAppName: 'egg',
  21. };
  22. config.cluster = {
  23. listen: {
  24. port: 6100,
  25. },
  26. };
  27. config.jwt = {
  28. ...jwt,
  29. expiresIn: '1d',
  30. issuer: 'baoan',
  31. };
  32. config.dbServerPort = '8090';
  33. config.dbServerIp = 'baoan.fwedzgc.com'; // 106.12.161.200
  34. config.wxServer = 'http://baoan.fwedzgc.com:8090';
  35. config.export = {
  36. root_path: 'D:\\temp\\',
  37. domain: 'http://127.0.0.1',
  38. };
  39. config.import = {
  40. domain: 'http://127.0.0.1',
  41. root_path: 'D:\\temp\\',
  42. };
  43. config.wxConfig = {
  44. appid: 'wxf7c766a58ace4bd6',
  45. secret: '615597e3b2e36314740f8954aa53b10d',
  46. };
  47. config.wx = new WechatAPI(
  48. config.wxConfig.appid,
  49. config.wxConfig.secret
  50. );
  51. config.wxAppConfig = {
  52. appid: 'wx68378872c2d354e9',
  53. secret: '14298fa90cbfe41f7726afcb6097aca2',
  54. };
  55. config.wxApp = new WechatAPI(
  56. config.wxAppConfig.appid,
  57. config.wxAppConfig.secret
  58. );
  59. config.dbName = 'wxCache';
  60. config.mongoose = {
  61. url: `mongodb://localhost:27017/${config.dbName}`,
  62. options: {
  63. user: 'c##baoandba',
  64. pass: 'baoan2021',
  65. authSource: 'admin',
  66. useNewUrlParser: true,
  67. useCreateIndex: true,
  68. },
  69. };
  70. // mq设置
  71. // config.amqp = {
  72. // client: {
  73. // hostname: '127.0.0.1',
  74. // username: 'visit',
  75. // password: 'visit',
  76. // vhost: 'platform',
  77. // },
  78. // app: true,
  79. // agent: true,
  80. // };
  81. // redis设置
  82. // config.redis = {
  83. // client: {
  84. // port: 6379, // Redis port
  85. // host: '127.0.0.1', // Redis host
  86. // password: '123456',
  87. // db: 1,
  88. // },
  89. // };
  90. return {
  91. ...config,
  92. ...userConfig,
  93. };
  94. };