config.default.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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: 2001,
  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/train/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. // 邮箱配置
  49. config.user_email = 'system@jilinjobs.cn';
  50. config.auth_code = 'vgWtywkwMJpN8QDL';
  51. // mq配置
  52. config.amqp = {
  53. client: {
  54. hostname: '127.0.0.1',
  55. username: 'visit',
  56. password: 'visit',
  57. vhost: 'train',
  58. },
  59. app: true,
  60. agent: true,
  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. // mongoose config
  72. config.mongoose = {
  73. url: 'mongodb://127.0.0.1:27017/train',
  74. options: {
  75. user: 'admin',
  76. pass: 'admin',
  77. authSource: 'admin',
  78. useNewUrlParser: true,
  79. useCreateIndex: true,
  80. },
  81. };
  82. // 安全配置
  83. config.security = {
  84. csrf: {
  85. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  86. enable: false,
  87. },
  88. };
  89. // // JWT config
  90. config.jwt = {
  91. ...jwt,
  92. expiresIn: '1d',
  93. issuer: 'train',
  94. };
  95. return {
  96. ...config,
  97. ...userConfig,
  98. };
  99. };