config.default.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. appid: 'wxd794d8f022ffd8c8',
  30. appSecret: 'ceb7f0986c76f227ae3049934c313f22',
  31. baseUrl: 'http://wx.cc-lotus.info', // 微信网关地址
  32. mchid: '1505364491', // 商户ID
  33. mchkey: '1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik9', // 商户key
  34. wxurl: 'https://zb.liaoningdoupo.com/api/wxpayback',
  35. payurl: 'https://api.mch.weixin.qq.com/pay/unifiedorder',
  36. };
  37. config.proxy = true;
  38. config.hostHeaders = 'x-forwarded-host';
  39. // 服务器发布路径
  40. config.baseUrl = 'https://zb.liaoningdoupo.com';
  41. // 认证回调地址
  42. config.authUrl = '/api/onlive/auth';
  43. // 直播appid与key
  44. config.sdkappid = 1400380125;
  45. config.secretkey = 'bea1ac1f8b0a65bc53feb105d290cada9ba26700364b14e48a1939eab4e65f62';
  46. config.mongoose = {
  47. url: 'mongodb://localhost:27017/liveplatform',
  48. options: {
  49. user: 'admin',
  50. pass: 'admin',
  51. authSource: 'admin',
  52. useNewUrlParser: true,
  53. useCreateIndex: true,
  54. useUnifiedTopology: true,
  55. },
  56. };
  57. // redis config
  58. config.redis = {
  59. client: {
  60. port: 6379, // Redis port
  61. host: '127.0.0.1', // Redis host
  62. password: 123456,
  63. db: 0,
  64. },
  65. };
  66. // 安全配置
  67. config.security = {
  68. csrf: {
  69. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  70. enable: false,
  71. },
  72. };
  73. // // JWT config
  74. config.jwt = {
  75. ...jwt,
  76. expiresIn: '1d',
  77. issuer: 'jobs',
  78. };
  79. config.view = {
  80. defaultViewEngine: 'nunjucks',
  81. mapping: {
  82. '.njk': 'nunjucks',
  83. },
  84. };
  85. return {
  86. ...config,
  87. ...userConfig,
  88. };
  89. };