config.default.js 2.1 KB

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