config.default.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. };
  42. config.proxy = true;
  43. config.hostHeaders = 'x-forwarded-host';
  44. // 服务器发布路径
  45. config.baseUrl = 'http://free.liaoningdoupo.com';
  46. // 认证回调地址
  47. config.authUrl = '/api/train/auth';
  48. // 回调地址
  49. config.redirect_uri = `${config.baseUrl}/weixin`;
  50. config.redirect_uri_doctor = `${config.baseUrl}/patient/manage`;
  51. config.redirect_uri_patient = `${config.baseUrl}/doctor/manage`;
  52. // base路径
  53. config.sendDirMq = 'http://wx.cc-lotus.info/api.weixin.qq.com/cgi-bin/message/template/send?appid=';
  54. // appID
  55. config.appid = 'wxdf3ed83c095be97a';
  56. config.REVIEW_TEMPLATE_ID = 'oqmozBcdkCzBOvNrdzMQ1lDJcobD5uBEpNoLWec0bPY';
  57. // 邮箱配置
  58. config.user_email = 'system@jilinjobs.cn';
  59. config.auth_code = 'vgWtywkwMJpN8QDL';
  60. // mq配置
  61. config.amqp = {
  62. client: {
  63. hostname: '127.0.0.1',
  64. username: 'visit',
  65. password: 'visit',
  66. vhost: 'train',
  67. },
  68. app: true,
  69. agent: true,
  70. };
  71. // redis config
  72. config.redis = {
  73. client: {
  74. port: 6379, // Redis port
  75. host: '127.0.0.1', // Redis host
  76. password: 123456,
  77. db: 0,
  78. },
  79. };
  80. // mongoose config
  81. config.mongoose = {
  82. url: 'mongodb://127.0.0.1:27017/train',
  83. options: {
  84. user: 'admin',
  85. pass: 'admin',
  86. authSource: 'admin',
  87. useNewUrlParser: true,
  88. useCreateIndex: true,
  89. },
  90. };
  91. // 安全配置
  92. config.security = {
  93. csrf: {
  94. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  95. enable: false,
  96. },
  97. };
  98. // // JWT config
  99. config.jwt = {
  100. ...jwt,
  101. expiresIn: '1d',
  102. issuer: 'train',
  103. };
  104. return {
  105. ...config,
  106. ...userConfig,
  107. };
  108. };