config.default.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 + '_1576744686394_2727';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. config.proxy = true;
  22. config.hostHeaders = 'x-forwarded-host';
  23. config.wxapi = {
  24. appid: 'wxa9997e40dea04213', // 微信公众号APPID
  25. appSecret: 'fef1a84c0c9a3ff56a7b2c7a23b7248f',
  26. baseUrl: 'http://wx.cc-lotus.info', // 微信网关地址
  27. mchid: '1505364491', // 商户ID
  28. mchkey: '1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik9', // 商户key
  29. wxurl: 'http://broadcast.waityou24.cn/api/visit/wxpayback',
  30. payurl: 'https://api.mch.weixin.qq.com/pay/unifiedorder',
  31. };
  32. // 服务器发布路径
  33. config.baseUrl = 'http://broadcast.waityou24.cn';
  34. // 认证回调地址
  35. config.authUrl = '/api/visit/auth';
  36. // 回调地址
  37. config.redirect_uri = `${config.baseUrl}/weixin`;
  38. config.redirect_uri_doctor = `${config.baseUrl}/patient/manage`;
  39. config.redirect_uri_patient = `${config.baseUrl}/doctor/manage`;
  40. config.errorMongo = {
  41. details: true,
  42. };
  43. config.errorHanler = {
  44. details: true,
  45. };
  46. // add your config here
  47. config.cluster = {
  48. listen: {
  49. port: 8888,
  50. },
  51. };
  52. // base路径
  53. config.sendDirMq = 'http://wx.cc-lotus.info/api.weixin.qq.com/cgi-bin/message/template/send?appid=';
  54. // appID
  55. config.appid = 'wxa9997e40dea04213';
  56. config.REVIEW_TEMPLATE_ID = 'BI4h0AQpdctm74I7-7PyHAspSMX2oJOTJVQsgrppOag';
  57. config.multipart = {
  58. fileSize: '50mb', // 文件大小
  59. mode: 'file', // 文件模式
  60. whitelist: [ '.xlsx' ], // 文件类型白名单
  61. };
  62. // redis config
  63. config.redis = {
  64. client: {
  65. port: 6379, // Redis port
  66. host: '127.0.0.1', // Redis host
  67. password: 123456,
  68. db: 0,
  69. },
  70. };
  71. config.amqp = {
  72. client: {
  73. hostname: '127.0.0.1',
  74. username: 'visit',
  75. password: 'visit',
  76. vhost: 'visit',
  77. },
  78. app: true,
  79. agent: true,
  80. };
  81. // mongoose config
  82. config.mongoose = {
  83. url: 'mongodb://127.0.0.1:27017/visit',
  84. options: {
  85. // user: 'admin',
  86. // pass: 'admin',
  87. // authSource: 'admin',
  88. // useNewUrlParser: true,
  89. // useCreateIndex: true,
  90. },
  91. };
  92. // 安全配置
  93. config.security = {
  94. csrf: {
  95. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  96. enable: false,
  97. },
  98. };
  99. // // JWT config
  100. config.jwt = {
  101. ...jwt,
  102. expiresIn: '1d',
  103. issuer: 'jobs',
  104. };
  105. config.view = {
  106. defaultViewEngine: 'nunjucks',
  107. mapping: {
  108. '.njk': 'nunjucks',
  109. },
  110. };
  111. return {
  112. ...config,
  113. ...userConfig,
  114. };
  115. };