config.default.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.wxapi = {
  34. appid: 'wxdf3ed83c095be97a', // 微信公众号APPID
  35. appSecret: '748df7c2a75077a79ae0c971b1638244',
  36. baseUrl: 'http://wx.cc-lotus.info', // 微信网关地址
  37. mchid: '1505364491', // 商户ID
  38. mchkey: '1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik9', // 商户key
  39. wxurl: 'http://free.liaoningdoupo.com/api/wxpayback',
  40. payurl: 'https://api.mch.weixin.qq.com/pay/unifiedorder',
  41. sendDirMq: 'http://wx.cc-lotus.info/api.weixin.qq.com/cgi-bin/message/template/send?appid=',
  42. };
  43. config.proxy = true;
  44. config.hostHeaders = 'x-forwarded-host';
  45. // 服务器发布路径
  46. config.baseUrl = 'http://free.liaoningdoupo.com';
  47. // 认证回调地址
  48. config.authUrl = '/api/train/auth';
  49. // 回调地址
  50. config.redirect_uri = `${config.baseUrl}/weixin`;
  51. config.redirect_uri_doctor = `${config.baseUrl}/patient/manage`;
  52. config.redirect_uri_patient = `${config.baseUrl}/doctor/manage`;
  53. // base路径
  54. // appID
  55. config.appid = 'wxdf3ed83c095be97a';
  56. config.REVIEW_TEMPLATE_ID = '16F_xIWRXcjefFgBw85uL1JtKYpKOy8tpO1ncG0PO3c';
  57. // 邮箱配置
  58. config.user_email = 'system@jilinjobs.cn';
  59. config.auth_code = 'vgWtywkwMJpN8QDL';
  60. // 导出配置
  61. config.cdn = {
  62. repos_root_path: '/usr/local/workspace/service-file/upload',
  63. repos_root_url_excel: '/excel/',
  64. repos_root_url_experience: '/experience/',
  65. };
  66. // mq配置
  67. // config.amqp = {
  68. // client: {
  69. // hostname: '127.0.0.1',
  70. // username: 'visit',
  71. // password: 'visit',
  72. // vhost: 'train',
  73. // },
  74. // app: true,
  75. // agent: true,
  76. // };
  77. // redis config
  78. config.redis = {
  79. client: {
  80. port: 6379, // Redis port
  81. host: '127.0.0.1', // Redis host
  82. password: '',
  83. db: 0,
  84. },
  85. };
  86. // mongoose config
  87. // config.mongoose = {
  88. // url: 'mongodb://127.0.0.1:27017/train',
  89. // options: {
  90. // // user: 'admin',
  91. // // pass: 'admin',
  92. // // authSource: 'admin',
  93. // // useNewUrlParser: true,
  94. // // useCreateIndex: true,
  95. // },
  96. // };
  97. config.mongoose = {
  98. url: 'mongodb://192.168.1.20:27017/train',
  99. options: {
  100. user: 'admin',
  101. pass: 'admin',
  102. authSource: 'admin',
  103. useUnifiedTopology: true,
  104. useNewUrlParser: true,
  105. useCreateIndex: true,
  106. },
  107. };
  108. // 安全配置
  109. config.security = {
  110. csrf: {
  111. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  112. enable: false,
  113. },
  114. };
  115. // // JWT config
  116. config.jwt = {
  117. ...jwt,
  118. expiresIn: '1d',
  119. issuer: 'train',
  120. };
  121. return {
  122. ...config,
  123. ...userConfig,
  124. };
  125. };