config.default.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. const { jwt } = require('./config.secret');
  4. /**
  5. * @param {Egg.EggAppInfo} appInfo app info
  6. */
  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 + '_1587024572540_7742';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. // add your config here
  22. config.cluster = {
  23. listen: {
  24. port: 5555,
  25. },
  26. };
  27. config.wxapi = {
  28. appid: 'wxdf3ed83c095be97a', // 微信公众号APPID
  29. appSecret: '748df7c2a75077a79ae0c971b1638244',
  30. baseUrl: 'http://wx.cc-lotus.info', // 微信网关地址
  31. mchid: '1505364491', // 商户ID
  32. mchkey: '1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik9', // 商户key
  33. wxurl: 'https://free.liaoningdoupo.com/api/onlive/wxpayback',
  34. payurl: 'https://api.mch.weixin.qq.com/pay/unifiedorder',
  35. };
  36. config.proxy = true;
  37. config.hostHeaders = 'x-forwarded-host';
  38. // 服务器发布路径
  39. config.baseUrl = 'https://free.liaoningdoupo.com';
  40. // 认证回调地址
  41. config.authUrl = '/api/onlive/auth';
  42. // 直播appid与key
  43. config.sdkappid = 1400414461;
  44. config.secretkey = '9726ce6e54b766c88903218c189dbcd11e7030613c076ff21bc0cc56c8072f24';
  45. config.mongoose = {
  46. url: 'mongodb://localhost:27017/liveplatform',
  47. options: {
  48. user: 'admin',
  49. pass: 'admin',
  50. authSource: 'admin',
  51. useNewUrlParser: true,
  52. useCreateIndex: true,
  53. useUnifiedTopology: true,
  54. },
  55. };
  56. // redis config
  57. config.redis = {
  58. client: {
  59. port: 6379, // Redis port
  60. host: '127.0.0.1', // Redis host
  61. password: 123456,
  62. db: 0,
  63. },
  64. };
  65. config.amqp = {
  66. client: {
  67. hostname: '127.0.0.1',
  68. username: 'live',
  69. password: 'live',
  70. vhost: 'live',
  71. },
  72. app: true,
  73. agent: true,
  74. };
  75. // 安全配置
  76. config.security = {
  77. csrf: {
  78. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  79. enable: false,
  80. },
  81. };
  82. // // JWT config
  83. config.jwt = {
  84. ...jwt,
  85. expiresIn: '1d',
  86. issuer: 'jobs',
  87. };
  88. config.view = {
  89. defaultViewEngine: 'nunjucks',
  90. mapping: {
  91. '.njk': 'nunjucks',
  92. },
  93. };
  94. return {
  95. ...config,
  96. ...userConfig,
  97. };
  98. };