config.default.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 + '_1578642242928_5726';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. config.errorMongo = {
  22. details: true,
  23. };
  24. config.errorHanler = {
  25. details: true,
  26. };
  27. // add your config here
  28. config.cluster = {
  29. listen: {
  30. port: 7001,
  31. },
  32. };
  33. config.proxy = true;
  34. config.hostHeaders = 'x-forwarded-host';
  35. // 服务器发布路径
  36. config.baseUrl = 'http://free.liaoningdoupo.com';
  37. // 认证回调地址
  38. config.authUrl = '/api/auth';
  39. // 回调地址
  40. config.redirect_uri = `${config.baseUrl}/weixin`;
  41. config.redirect_uri_doctor = `${config.baseUrl}/patient/manage`;
  42. config.redirect_uri_patient = `${config.baseUrl}/doctor/manage`;
  43. // base路径
  44. config.sendDirMq = 'http://wx.cc-lotus.info/api.weixin.qq.com/cgi-bin/message/template/send?appid=';
  45. // appID
  46. config.appid = 'wxdf3ed83c095be97a';
  47. config.REVIEW_TEMPLATE_ID = 'oqmozBcdkCzBOvNrdzMQ1lDJcobD5uBEpNoLWec0bPY';
  48. // config.amqp = {
  49. // client: {
  50. // hostname: '127.0.0.1',
  51. // username: 'visit',
  52. // password: 'visit123',
  53. // vhost: 'visit',
  54. // },
  55. // app: true,
  56. // agent: true,
  57. // };
  58. // mongoose config
  59. config.mongoose = {
  60. url: 'mongodb://127.0.0.1:27017/train',
  61. options: {
  62. user: 'admin',
  63. pass: 'admin',
  64. authSource: 'admin',
  65. useNewUrlParser: true,
  66. useCreateIndex: true,
  67. },
  68. };
  69. // 安全配置
  70. config.security = {
  71. csrf: {
  72. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  73. enable: false,
  74. },
  75. };
  76. // // JWT config
  77. config.jwt = {
  78. ...jwt,
  79. expiresIn: '1d',
  80. issuer: 'train',
  81. };
  82. return {
  83. ...config,
  84. ...userConfig,
  85. };
  86. };