config.default.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. // 签到小程序
  44. config.wxapp = {
  45. appid: 'wx3b5ac763ada73e0e',
  46. secret: '0f30fcbb9ad45697800611ad4af585bb',
  47. grant_type: 'authorization_code',
  48. };
  49. config.proxy = true;
  50. config.hostHeaders = 'x-forwarded-host';
  51. // 服务器发布路径
  52. config.baseUrl = 'http://free.liaoningdoupo.com';
  53. // 认证回调地址
  54. config.authUrl = '/api/train/auth';
  55. // 回调地址
  56. config.redirect_uri = `${config.baseUrl}/weixin`;
  57. config.redirect_uri_doctor = `${config.baseUrl}/patient/manage`;
  58. config.redirect_uri_patient = `${config.baseUrl}/doctor/manage`;
  59. // base路径
  60. // appID
  61. config.appid = 'wxdf3ed83c095be97a';
  62. config.REVIEW_TEMPLATE_ID = '16F_xIWRXcjefFgBw85uL1JtKYpKOy8tpO1ncG0PO3c';
  63. // 邮箱配置
  64. config.user_email = 'system@jilinjobs.cn';
  65. config.auth_code = 'vgWtywkwMJpN8QDL';
  66. // 导出配置
  67. config.cdn = {
  68. repos_root_path: '/usr/local/workspace/service-file/upload',
  69. repos_root_url_excel: '/excel/',
  70. repos_root_url_experience: '/experience/',
  71. repos_root_url_zip: '/zip/',
  72. };
  73. // mq配置
  74. // config.amqp = {
  75. // client: {
  76. // hostname: '127.0.0.1',
  77. // username: 'visit',
  78. // password: 'visit',
  79. // vhost: 'train',
  80. // },
  81. // app: true,
  82. // agent: true,
  83. // };
  84. // redis config
  85. config.redis = {
  86. client: {
  87. port: 6379, // Redis port
  88. host: '127.0.0.1', // Redis host
  89. password: '',
  90. db: 0,
  91. },
  92. };
  93. // mongoose config
  94. // config.mongoose = {
  95. // url: 'mongodb://127.0.0.1:27017/train',
  96. // options: {
  97. // // user: 'admin',
  98. // // pass: 'admin',
  99. // // authSource: 'admin',
  100. // // useNewUrlParser: true,
  101. // // useCreateIndex: true,
  102. // },
  103. // };
  104. config.mongoose = {
  105. url: 'mongodb://192.168.1.20:27017/train',
  106. options: {
  107. user: 'admin',
  108. pass: 'admin',
  109. authSource: 'admin',
  110. useUnifiedTopology: true,
  111. useNewUrlParser: true,
  112. useCreateIndex: true,
  113. },
  114. };
  115. // 安全配置
  116. config.security = {
  117. csrf: {
  118. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  119. enable: false,
  120. },
  121. };
  122. // // JWT config
  123. config.jwt = {
  124. ...jwt,
  125. expiresIn: '1d',
  126. issuer: 'train',
  127. };
  128. return {
  129. ...config,
  130. ...userConfig,
  131. };
  132. };