config.default.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. // 邮箱配置
  49. config.user_email = '1345526645@qq.com';
  50. config.auth_code = 'vnrzrxwserhyfeda';
  51. // config.amqp = {
  52. // client: {
  53. // hostname: '127.0.0.1',
  54. // username: 'visit',
  55. // password: 'visit123',
  56. // vhost: 'visit',
  57. // },
  58. // app: true,
  59. // agent: true,
  60. // };
  61. // mongoose config
  62. config.mongoose = {
  63. url: 'mongodb://127.0.0.1:27017/train',
  64. options: {
  65. user: 'admin',
  66. pass: 'admin',
  67. authSource: 'admin',
  68. useNewUrlParser: true,
  69. useCreateIndex: true,
  70. },
  71. };
  72. // 安全配置
  73. config.security = {
  74. csrf: {
  75. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  76. enable: false,
  77. },
  78. };
  79. // // JWT config
  80. config.jwt = {
  81. ...jwt,
  82. expiresIn: '1d',
  83. issuer: 'train',
  84. };
  85. return {
  86. ...config,
  87. ...userConfig,
  88. };
  89. };